Stress Testing
- In Turkish
- Stres Testi
In short
Stress testing pushes a system beyond its expected workload on purpose to find its breaking point and to check that it fails gracefully and recovers afterward.
What is stress testing?
Stress testing deliberately overloads a system to learn where and how it breaks. The goal is not to confirm that performance targets are met, but to find the limit, see which component gives out first, and check that the system fails gracefully. Failing gracefully means rejecting extra requests with clear errors and slowing down in a controlled way, rather than crashing, losing data, or taking other services down with it.
A stress test usually ramps traffic up in steps, for example doubling the number of virtual users every few minutes, until well past the expected peak. While it runs, the team watches error rates, response times, CPU, memory, connection pools, and queue lengths. Stress can also target other resources, such as filling a disk, limiting memory, or making a dependency very slow. Once the system breaks, the load is removed to check recovery: whether it comes back on its own, and how long that takes.
Think of engineers testing a new chair by piling on weight until it breaks. They learn the safety margin and whether the chair bends slowly or snaps without warning. Teams run stress tests before big launches, for capacity planning, and to confirm that protections such as rate limiting, circuit breakers, backpressure, and autoscaling limits actually work under overload.
Stress testing is often confused with load testing. A load test checks behavior at the traffic you expect, such as a normal busy day, while a stress test goes beyond that level on purpose. It also differs from chaos engineering, which injects failures such as a crashed server or a slow network to test resilience, while stress testing overwhelms the system with work. Spike tests, which apply a sudden burst of traffic, are often treated as a kind of stress test.
Key takeaways
- Stress testing pushes a system past its expected load to find the breaking point.
- It reveals which resource or component fails first.
- A good result is graceful failure and quick recovery, not just a high limit.
- Load testing checks expected traffic; stress testing deliberately exceeds it.
- Only stress-test systems you own, ideally in an isolated environment.
Example
const URL = "http://localhost:8000/"; // only stress-test systems you own
const attempt = () =>
fetch(URL, { signal: AbortSignal.timeout(2000) }).then((res) => res.ok, () => false);
// Double the concurrent users until more than 5% of requests fail
for (let users = 50; users <= 12800; users *= 2) {
const results = await Promise.all(Array.from({ length: users }, attempt));
const errorRate = results.filter((ok) => !ok).length / users;
console.log(`${users} users: ${(errorRate * 100).toFixed(1)}% errors`);
if (errorRate > 0.05) break;
}Readers ask
What is the difference between stress testing and load testing?
Load testing measures performance under the traffic you expect. Stress testing pushes beyond that level to find the breaking point and to see how the system fails and recovers.
What does it mean for a system to fail gracefully?
It means that under overload the system degrades in a controlled way, for example by rejecting some requests with a clear error such as HTTP 503, instead of crashing, corrupting data, or causing failures in other services.
What is a spike test?
A spike test applies a sudden, large burst of traffic, such as ten times the normal load within seconds, to check how the system handles abrupt surges and how quickly it returns to normal afterward.
See also
- Load TestingTesting & Quality, p. 15Load testing is a type of performance testing that simulates many users or requests at once to measure how a system behaves under expected traffic.
- Chaos EngineeringDevOps & Cloud, p. 8Chaos engineering is the practice of deliberately injecting failures into a system, such as crashing servers, to confirm that it keeps working as expected.
- ScalabilitySoftware Architecture, p. 36Scalability is a system's ability to handle growing amounts of work, such as more users or data, by adding resources without a drop in performance.
- Rate LimitingBackend & APIs, p. 37Rate limiting is a technique that caps how many requests a client can make to a server or API within a time window, protecting it from abuse and overload.
- BackpressureBackend & APIs, p. 7Backpressure is a mechanism that lets a slow consumer signal a fast producer to slow down, so data doesn't pile up faster than it can be processed.
- Circuit Breaker PatternSoftware Architecture, p. 4The circuit breaker pattern protects a system by stopping calls to a failing dependency for a while and failing fast instead of waiting on timeouts.
- Performance TestingTesting & Quality, p. 18Performance testing measures how fast, stable and scalable a system is under expected and extreme load, from response times to its breaking point.
Spotted a mistake or something missing on this page?Suggest an edit