A load test passed. Production fell over anyway.
It happens more than teams admit, and the cause is usually not a bad tool or a bad script. It is one of a handful of setup mistakes that make the test measure something other than the real system. Fix the setup, and the green result starts meaning something.
1. Running all the load from one machine
A single load generator has its own limits: CPU, memory, network, and open connections. Push it hard enough and the generator slows down before the system under test does. The report shows flat response times and a low error rate, and the team concludes the system is fine. What actually happened is the generator could not send any more load.
Fix: watch the generator the same way you watch the system. If generator CPU is high, or connections are timing out at the source, add generators and spread the load across machines. A generator that is itself saturated tells you nothing about the system.
2. Testing against a warm cache
Test data is usually tidy, and the cache is usually warm before the run starts. Every search hits cached results, every product page is already in memory, and the numbers look great.
Production is not like that. Caches are cold after a deploy, at the start of a sale, or when a new product goes live. The first wave of real users pays the full price of a cache miss.
Fix: run at least one scenario with a cold cache. Clear the cache before the run, or start the test right after a restart, and watch what happens to response times in the first minutes. If the system only survives when the cache is warm, say so in the report.
3. Testing against a tenth of the data
A test database with a fraction of production data behaves differently. Queries that scan a small table in test will scan a much larger one in production. Indexes that fit in memory in test may not fit in production. A search that returns ten rows in test may return ten thousand live.
Fix: load the test database to a realistic size, or at least to a size where the query plans match production. Where you cannot, write the difference down. A result that names its own gap is useful. A result that hides it is not.
4. Mocking the third-party calls away
Payment gateways, identity providers, and external APIs are often mocked or stubbed during a test, because the real ones are slow, rate-limited, or charge per call. A mocked call answers instantly, every time.
In production those calls are shared, rate-limited, and slow at the worst moments. A checkout flow that waits on a payment service behaves very differently when that service answers in 800 ms instead of 5 ms.
Fix: include the real dependencies wherever you can. Where you cannot, simulate their latency realistically instead of assuming instant responses. Record the assumed latency in the report, so nobody mistakes a stub for the real thing.
5. Testing only the happy path
Most scripts follow the golden flow: log in, search, add to cart, check out. Every step succeeds. Real users do more than that. They enter a wrong password, they apply an expired coupon, they hit back, they retry a failed payment.
Error paths are often the slowest paths. A failed login can trigger an extra lookup, a retry loop can triple the calls, and a timeout can hold a connection open. A test that never exercises them never finds out.
Fix: add failure scenarios to the script mix. A small share of wrong logins, bad inputs, and retries changes the load shape and exposes the paths production actually takes.
6. Trusting a single run
One run is a snapshot, not a verdict. A test can pass on a quiet morning and fail on a busy afternoon for reasons that have nothing to do with the code: a noisy neighbour on shared infrastructure, a backup job, or a cache that was warmer the second time.
Fix: run the same scenario more than once and look at the spread. If the results swing widely between runs, that instability is itself a finding. Report the range, not just the best run.
A concrete example: the sale that passed in test
Take a retail site preparing for a sale. The test ran 5,000 virtual users from one generator, against a warm cache, a small database, and a mocked payment service. It passed.
On sale day, 2,000 real users arrived in the first ten minutes. The cache was cold after the morning deploy. The payment service slowed under the real load. The generator in the test had been the bottleneck all along, so the system had never actually seen 5,000 users. The site slowed to a crawl before noon.
None of those problems was a mystery. Each one was a setup choice the test had made quietly. Name the choices, fix the ones you can, and write down the ones you cannot. That is what turns a passing test into an honest one.
A load test passed. Production fell over anyway.
It happens more than teams admit, and the cause is usually not a bad tool or a bad script. It is one of a handful of setup mistakes that make the test measure something other than the real system. Fix the setup, and the green result starts meaning something.
1. Running all the load from one machine
A single load generator has its own limits: CPU, memory, network, and open connections. Push it hard enough and the generator slows down before the system under test does. The report shows flat response times and a low error rate, and the team concludes the system is fine. What actually happened is the generator could not send any more load.
Fix: watch the generator the same way you watch the system. If generator CPU is high, or connections are timing out at the source, add generators and spread the load across machines. A generator that is itself saturated tells you nothing about the system.
2. Testing against a warm cache
Test data is usually tidy, and the cache is usually warm before the run starts. Every search hits cached results, every product page is already in memory, and the numbers look great.
Production is not like that. Caches are cold after a deploy, at the start of a sale, or when a new product goes live. The first wave of real users pays the full price of a cache miss.
Fix: run at least one scenario with a cold cache. Clear the cache before the run, or start the test right after a restart, and watch what happens to response times in the first minutes. If the system only survives when the cache is warm, say so in the report.
3. Testing against a tenth of the data
A test database with a fraction of production data behaves differently. Queries that scan a small table in test will scan a much larger one in production. Indexes that fit in memory in test may not fit in production. A search that returns ten rows in test may return ten thousand live.
Fix: load the test database to a realistic size, or at least to a size where the query plans match production. Where you cannot, write the difference down. A result that names its own gap is useful. A result that hides it is not.
4. Mocking the third-party calls away
Payment gateways, identity providers, and external APIs are often mocked or stubbed during a test, because the real ones are slow, rate-limited, or charge per call. A mocked call answers instantly, every time.
In production those calls are shared, rate-limited, and slow at the worst moments. A checkout flow that waits on a payment service behaves very differently when that service answers in 800 ms instead of 5 ms.
Fix: include the real dependencies wherever you can. Where you cannot, simulate their latency realistically instead of assuming instant responses. Record the assumed latency in the report, so nobody mistakes a stub for the real thing.
5. Testing only the happy path
Most scripts follow the golden flow: log in, search, add to cart, check out. Every step succeeds. Real users do more than that. They enter a wrong password, they apply an expired coupon, they hit back, they retry a failed payment.
Error paths are often the slowest paths. A failed login can trigger an extra lookup, a retry loop can triple the calls, and a timeout can hold a connection open. A test that never exercises them never finds out.
Fix: add failure scenarios to the script mix. A small share of wrong logins, bad inputs, and retries changes the load shape and exposes the paths production actually takes.
6. Trusting a single run
One run is a snapshot, not a verdict. A test can pass on a quiet morning and fail on a busy afternoon for reasons that have nothing to do with the code: a noisy neighbour on shared infrastructure, a backup job, or a cache that was warmer the second time.
Fix: run the same scenario more than once and look at the spread. If the results swing widely between runs, that instability is itself a finding. Report the range, not just the best run.
A concrete example: the sale that passed in test
Take a retail site preparing for a sale. The test ran 5,000 virtual users from one generator, against a warm cache, a small database, and a mocked payment service. It passed.
On sale day, 2,000 real users arrived in the first ten minutes. The cache was cold after the morning deploy. The payment service slowed under the real load. The generator in the test had been the bottleneck all along, so the system had never actually seen 5,000 users. The site slowed to a crawl before noon.
None of those problems was a mystery. Each one was a setup choice the test had made quietly. Name the choices, fix the ones you can, and write down the ones you cannot. That is what turns a passing test into an honest one.

Comments
Post a Comment