Blog

How stress testing works

Stress testing (load testing) is the process of generating controlled traffic to validate how a service behaves under pressure. The goal is not “maximum damage” — it’s to find capacity limits, performance bottlenecks, and failure modes so you can fix them.

1) What a stress test actually measures

A good test focuses on outcomes: response time (latency), throughput (RPS), error rate, and resource usage (CPU, memory, network). The same number of requests can be “easy” or “hard” depending on cache hit rate, database queries, TLS overhead, and payload size.

2) Traffic patterns: ramp, spike, soak

  • Ramp: gradually increases load to locate the knee point where latency rises sharply.
  • Spike: sudden load increase to see how autoscaling and queues behave.
  • Soak: steady load over time to reveal memory leaks, slow degradation, or exhausted pools.

3) Common failure points

Most production incidents during load come from dependencies: database connection limits, slow queries, cache stampedes, thread pool starvation, rate limits, and upstream timeouts. Testing helps you find these before users do.

4) What to record during a test

  • p50 / p95 / p99 latency
  • RPS (successful vs failed)
  • HTTP status distribution, timeouts, and connection errors
  • CPU, memory, GC, DB connections, cache hit rate

5) Safe best practices

Only test systems you own or have explicit permission to test. Start in staging, then run limited production tests with guardrails: allowlists, strict rate limits, short durations, and clear rollback plans.