Load test results that don't match production
A load test passes at the target request rate with p95 inside the budget, the release ships, and production at that same rate misses the budget in its first busy hour. The test and production can differ in how requests were paced, how long the run lasted against a burst credit balance, how many rows the database held and what was already in cache. A load generator short of CPU errs in the other direction and makes the application look slower than it is. Each of these can be checked before the rerun, and the answers show whether it needs a different script or a different environment.
Coordinated omission under a closed model
In a closed model, a virtual user starts its next iteration only when the previous one finishes. When the server stalls, every virtual user waits with it, the request rate drops, and the requests that would have arrived during the stall are never sent. Production traffic keeps arriving while the server is slow.
Example 2 in Gil Tene's README for wrk2 shows the size of the error on one run. It sent 2,000 requests a second to a local Apache server for 30 seconds, and the server process was suspended once, for 1.4 seconds. The output lists latency two ways.
| Percentile | Timed from when the request was sent | Timed from when it was due to be sent |
|---|---|---|
| 50th | 3.02 ms | 8.61 ms |
| 90th | 4.87 ms | 11.77 ms |
| 99th | 6.04 ms | 1.27 s |
| 99.9th | 1.41 s | 1.42 s |
Both columns describe the same 30 seconds. A report built on the left column says p99 is 6 ms. In the right column, one request in a hundred took 1.27 seconds or longer.
To see whether the last test ran a closed model, open its script. In k6, constant-arrival-rate and ramping-arrival-rate start iterations on a schedule, so response times no longer set the load. With constant-vus and ramping-vus, each virtual user runs as many iterations as it can, one after another, which is the closed model. An arrival rate run still skips iterations when it runs out of free virtual users, and k6 counts those in dropped_iterations, so that counter belongs in the report beside the percentiles. A closed model also shows in the run's graphs, where the request rate dips each time latency spikes. Sizing a load test environment from last quarter's peak traffic shows a script written as arrivals per second.
When the test ends before the burst credits do
Burstable instances in standard mode and gp2 volumes under 1 TiB run above their baseline only while a credit balance lasts. A short test on an idle server can finish before the balance does.
AWS publishes the arithmetic. A 100 GiB gp2 volume has a baseline of 300 IOPS and, starting from a full balance, bursts to 3,000 IOPS for 2,000 seconds. On that volume, a thirty minute test that asks for 3,000 IOPS can draw ten times the IOPS that a production volume of the same size gets once its balance is spent.
CPU credits work the same way on T3 instances in standard mode. A t3.large earns 36 credits an hour and holds at most 864, which is what it earns in 24 hours. At full load on both vCPUs it spends 2 credits a minute while earning 0.6, so a full balance lasts 864 ÷ 1.4, about 617 minutes. A test server left idle for a day starts the run close to full. The same instance type in production, in standard mode with its balance spent, comes down to its baseline of 30 percent per vCPU. T3 instances launch in unlimited mode by default, which keeps the CPU available and bills the extra usage, so the credit mode has to match along with the instance type.
Read CPUCreditBalance and BurstBalance on both sides before the rerun. Where production runs on credits, start the test with the balances production carries in its busy hour. A gp3 volume has no burst balance, and its baseline of 3,000 IOPS and 125 MiB/s comes with the storage price. Private vs public cloud once the application is in production covers both credit systems.
Row counts, planner statistics and a cold cache
The PostgreSQL manual warns against carrying EXPLAIN results from a small table over to a large one, because the planner's cost estimates are not linear and it may pick a different plan at a different size. After a bulk load the manual says to run ANALYZE, since the planner can choose poorly from missing or obsolete statistics. Autovacuum may run it for you, so read last_analyze and last_autoanalyze in pg_stat_user_tables and confirm one of them is later than the load. Row and page estimates for each table sit in pg_class as reltuples and relpages. Compare them for the largest tables on both sides.
Run the test's slowest queries under EXPLAIN (ANALYZE, BUFFERS) in both places and read two things: whether the plan nodes match, and how the shared blocks split between hits and reads. A hit means the block was already in cache. The ANALYZE option executes the statement, so on production wrap anything that writes in BEGIN and ROLLBACK.
A newly built test database starts with empty shared buffers, while production's have been filling since its last restart. The opposite problem comes from a script that loops over the same short list of accounts, because every block it needs is cached after the first pass. To start warm on purpose, pg_prewarm loads a relation into the buffer cache before the run.
Save the row counts of the largest tables with the test results, so the next run can be checked against the same dataset.
20 percent idle CPU on the load generator
The k6 guide to large tests says a generator running at 100 percent CPU can report response times much larger than the server produced, and it recommends sizing the machine so at least 20 percent stays idle. Watch CPU, memory and network on the generator during the run and save the graphs with the results. A saturated generator makes a healthy application look slow, so rule it out before changing anything on the server.
Write the differences down before the rerun
Fill in each row for production and for the test environment, and attach the sheet to the test report.
| What to compare | Where to read it | What a mismatch does |
|---|---|---|
| Load model | The scenario's executor, and dropped_iterations on an arrival rate run | A closed model sends less traffic during a stall, and the percentiles miss the stall |
| CPU credit mode and balance | CPUCreditBalance, plus standard or unlimited mode on each instance | The test side keeps full CPU for hours after production has come down to baseline |
| Volume type and burst balance | BurstBalance on each gp2 volume | A short run never leaves burst IOPS |
| Row counts and statistics | reltuples in pg_class, with last_analyze and last_autoanalyze in pg_stat_user_tables | The same query gets a different plan |
| Cache state at the start | Shared block hits and reads under EXPLAIN (ANALYZE, BUFFERS) | Cold reads slow the start of the run, and a narrow loop hides them for the whole run |
| Engine version and settings | SHOW server_version, then pg_settings on both sides | Memory and connection limits can change the rate at which the database gives out |
| Generator headroom | CPU on the generator, with 20 percent idle as the floor | Reported latency exceeds what the server produced |
When a run exposes a bottleneck, change one setting, rerun on the same environment, and keep both results so the before and after can be compared.
What a separate environment leaves unmeasured
A performance environment on other hardware or with another provider than production starts its difference list with that fact. Tests there answer two questions well: whether this release is slower than the last one on the same environment, and where the application fails first as the arrival rate climbs. They predict production's exact p99 less well. A managed database or queue that exists only inside one provider has no copy elsewhere, so a test aimed at one of those belongs next to production.
To see how far a result carries, run the test once at a rate production already handles and compare the percentiles with production's own at that rate. The gap at a known rate shows how much to trust the result at a rate production has yet to see.
Sources
The statements about wrk2, k6, AWS and PostgreSQL come from these pages, last read on November 10, 2026. Pages nine to sixteen come from the PostgreSQL 18 manual.
- Example 2 and coordinated omission, wrk2 README by Gil Tene: https://github.com/giltene/wrk2
- Open and closed models, k6 documentation: https://grafana.com/docs/k6/latest/using-k6/scenarios/concepts/open-vs-closed/
- Executors, k6 documentation: https://grafana.com/docs/k6/latest/using-k6/scenarios/executors/
- Dropped iterations, k6 documentation: https://grafana.com/docs/k6/latest/using-k6/scenarios/concepts/dropped-iterations/
- Running large tests, k6 documentation: https://grafana.com/docs/k6/latest/testing-guides/running-large-tests/
- General Purpose SSD volumes, Amazon EBS User Guide: https://docs.aws.amazon.com/ebs/latest/userguide/general-purpose.html
- Key concepts for burstable performance instances, Amazon EC2 User Guide: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-credits-baseline-concepts.html
- Monitor CPU credits for burstable instances, Amazon EC2 User Guide: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances-monitoring-cpu-credits.html
- Using EXPLAIN, PostgreSQL manual: https://www.postgresql.org/docs/current/using-explain.html
- Populating a database: https://www.postgresql.org/docs/current/populate.html
- The cumulative statistics system: https://www.postgresql.org/docs/current/monitoring-stats.html
- Statistics used by the planner: https://www.postgresql.org/docs/current/planner-stats.html
- EXPLAIN command reference: https://www.postgresql.org/docs/current/sql-explain.html
- pg_prewarm module: https://www.postgresql.org/docs/current/pgprewarm.html
- SHOW command reference: https://www.postgresql.org/docs/current/sql-show.html
- pg_settings view: https://www.postgresql.org/docs/current/view-pg-settings.html