Part 01 · Measuring Performance
Coordinated Omission
Most load tests quietly skip the worst moments. How coordinated omission hides latency and how to measure correctly.
⏱ 9 min · Station 5 of 95
The problem
Before the sale, the team runs a load test with 4 virtual users hammering the shop and proudly reports "p99: 6 ms". During that same test, the shop froze completely twice, for 2 seconds each time (a long garbage-collection pause, a lock, a stuck dependency). The test saw the freezes and still reported a p99 of 6 milliseconds.
The test didn't lie about any single request. It lied by not sending the requests that would have shown the problem. That's coordinated omission, and most load tests and many monitoring tools do it by default.
The idea
A closed-model load test (a fixed number of users, each sending the next request only after the previous one returns) coordinates with the system under test without meaning to:
- When the system freezes, each user is stuck waiting on one request.
- While stuck, it sends nothing. The requests that real users would have sent during those 2 seconds are never made, so they're never measured.
- After the freeze, each user records one slow request (2 seconds) and continues. Out of thousands of samples, only 4 are slow. The p99 doesn't notice.
Real users don't coordinate: they keep arriving whether the shop is frozen or not. Every one of them who arrives during a 2-second freeze waits up to 2 seconds. An open-model test (a fixed arrival rate, k6's constant-arrival-rate) behaves like that, so it records the waits.
The same trap exists outside load testing: anything that measures "how long did my request take" from a client that waits before sending the next one (health checkers, synthetic monitors, some benchmark tools) under-reports stalls.
How it works
Consider about 190 requests per second and a 2-second freeze:
- Closed model, 4 users: during the freeze, 4 requests are in flight and nothing else is sent. 4 samples of about 2 s are recorded. Over a 30-second test with two freezes: 8 slow samples out of 4,500, 0.18%. The p99 is computed from the other 99.8%.
- Open model, 190/s: during each freeze, about 380 requests arrive. The first waits 2 s, the last a few milliseconds, on average about 1 s. Two freezes: about 760 slow samples out of 5,700, 13%. Both p95 and p99 land inside the freeze.
What a user experiences is the second picture: 13% of the time, the shop is unusable.
A 30 s test, the shop freezes twice for 2 s each. Closed model: 4 users with 20 ms think time (~190/s when healthy). What p99 does the closed-model test report?
Visual
Common misconception
"More virtual users fix it." They make the hole smaller (more requests stuck per freeze) but don't remove it: as long as users wait for responses before sending, the test sends less exactly when the system is slowest. The fix is the arrival model, not the user count.
"The max shows the freeze, so it's fine." The max shows that one request was slow. It doesn't tell you that 13% of users were affected, and SLOs and decisions are made on percentiles. A p99 of 6 ms next to a max of 2,003 ms is a sign of coordinated omission, not of a healthy system.
Break it, then fix it
Measured on the lab (Intel i3-10110U). The shop has an /admin/stall endpoint that freezes request handling for a given time, like a long pause. co.sh runs the same 30-second test twice, closed then open, at about the same healthy rate, and freezes the shop for 2 seconds at 10 s and 20 s:
cd ../../lab
docker compose up -d api >/dev/null 2>&1; sleep 2
stalls() { sleep 10; curl -s -X POST "localhost:58080/admin/stall?ms=2000"; sleep 10; curl -s -X POST "localhost:58080/admin/stall?ms=2000"; }
echo "== closed model: 4 users, 20 ms think time (~190 requests/s); the shop freezes for 2 s at 10 s and 20 s"
./k6.sh vus.js -e VUS=4 -e SLEEP=0.02 -e DURATION=30s -e "PATH_TPL=/work?ms=1" 2>/dev/null | grep -E "requests|latency" &
stalls; wait
echo "== open model: 190 requests/s arrive no matter what; the same two freezes"
./k6.sh product.js -e RATE=190 -e DURATION=30s -e "PATH_TPL=/work?ms=1" 2>/dev/null | grep -E "requests|latency|dropped" &
stalls; wait
== closed model: 4 users, 20 ms think time (~190 requests/s); the shop freezes for 2 s at 10 s and 20 s
requests 4506 (150.1/s)
latency avg 5.7 ms p50 1.8 ms p95 4.0 ms p99 6.1 ms max 2003 ms
== open model: 190 requests/s arrive no matter what; the same two freezes
requests 5448 (181.6/s)
latency avg 126 ms p50 1.6 ms p95 1302 ms p99 2050 ms max 2258 ms
dropped 253 (k6 could not start them in time)
| Closed (4 users) | Open (190/s) | |
|---|---|---|
| Requests sent | 4,506 (150/s) | 5,448 (182/s) |
| p50 | 1.8 ms | 1.6 ms |
| p95 | 4.0 ms | 1,302 ms |
| p99 | 6.1 ms | 2,050 ms |
| max | 2,003 ms | 2,258 ms |
- The broken measurement: the closed-model test sent fewer requests overall (150/s instead of 190/s: it stopped sending during the freezes) and reported p99 6.1 ms. By its numbers, the shop is healthy.
- The fix: the open-model test kept requests arriving and reported p95 1.3 s, p99 2.05 s: the freeze, as users would feel it.
- The "dropped 253" in the open run is k6 running out of pre-allocated users during the freeze; those requests would have waited too, so even the open number slightly under-reports.
Engineering insight
- Use an arrival-rate executor for anything about latency under load. Closed models are fine for "how many requests can 4 workers push?" and wrong for "how long do users wait?".
- Check the shape of your load tool's output. A healthy-looking p99 next to a huge max, or achieved throughput dropping below what you asked for during a test, are signs that the test backed off.
- Server-side latency histograms are not immune either. If a request waits in a queue before the server's timer starts (as in the last lesson), the server under-reports in the same way. Measure from the client side or the load balancer as well.
- Tools that correct for it exist (HdrHistogram's expected-interval correction, wrk2's constant throughput mode), but the simplest correction is to generate load the way users do: on a schedule.
Key takeaway
A load test whose users wait for each response stops sending when the system stalls, so the stall barely reaches its percentiles: here two 2-second freezes produced a p99 of 6.1 ms. Generating load at a fixed arrival rate records every user who arrives during the stall: p99 2.05 s for the same freezes.
Practice
Objective: reason about when a stall becomes visible in a closed-model p99.
Challenge: with 4 users and about 4,500 requests per 30 seconds, how many 2-second freezes would it take before the closed-model p99 shows a slow value? And in the open model at 190 requests per second, what share of requests is affected by one 2-second freeze per 30 seconds?
Expected result: a number of freezes and a percentage, and what they say about trusting each test.
Hint 1
p99 shows a slow value once more than 1% of samples are slow.
Hint 2
Closed model: each freeze adds only as many slow samples as there are users.
Hint 3
Open model: every request that arrives during the freeze is slow; that's 2 s of arrivals out of 30 s.
Solution
- Closed model: 1% of 4,500 is 45 slow samples. Each freeze adds 4. It would take about 12 freezes in 30 seconds (one every 2.5 seconds, the shop frozen 80% of the time) before the p99 noticed.
- Open model: one 2-second freeze per 30 seconds affects 2/30 ≈ 6.7% of requests, enough to put the p95 inside the freeze.
The closed-model test is blind to stalls almost entirely; the open-model test sees even one. When the numbers decide whether the sale will hold, use the one that behaves like customers.
Interview check
Q: A benchmark of your service with 50 concurrent connections shows p99 = 12 ms, but in production p99 is 900 ms at the same throughput. What might explain the difference?
Model answer
Coordinated omission is a strong candidate: a fixed-concurrency benchmark stops sending while the service stalls, so pauses (GC, locks, slow dependencies) barely appear in its percentiles, while production users keep arriving and wait through them. Re-run with a constant arrival rate (k6 arrival-rate executors, wrk2) at production throughput, and compare. Also check that production latency includes queueing and network time the benchmark doesn't have.
Q: How would you tell from a load test report alone that coordinated omission may have happened?
Model answer
The achieved request rate is lower than the target or drops during the test, the max is orders of magnitude above the p99, or latency over time shows gaps (no samples) at the same moments as spikes. All of these mean the generator sent less while the system was slow. A test where the arrival schedule is fixed and the achieved rate matches the target doesn't have this problem.
Station stamp
Finish the chapter
Done reading? Press Complete to save your progress. XP is Pro-only — on Pro this chapter is worth +10 XP.
Go Pro to earn XP →