Q&A-7Explain and prevent coordinated omission.
Answer
Core answer
Coordinated omission is the bias you get when the load generator's request rate is coupled to the system's response rate. A closed-loop generator holds N workers, each sending its next request only after the previous one returns. When the system stalls, the generator stalls with it: the requests that would have arrived during the stall are never sent, so they never produce a latency sample. The stall gets recorded N times, once per worker, instead of once per would-be arrival, and the tail of the distribution is underweighted by orders of magnitude.
The fix is to decouple arrival from completion. Schedule requests on a fixed timeline (open-loop), and measure each request's latency from its intended start time, not from the moment the generator actually got around to sending it.
Worked example
100 closed-loop workers, 10 ms service time, so 10,000 req/s offered. The server stalls for 1 s (GC pause, lock convoy, whatever). Run length 60 s.
| closed-loop | open-loop at 10,000/s | |
|---|---|---|
| requests in the 59 normal seconds | 590,000 @ 10 ms | 590,000 @ 10 ms |
| requests during the 1 s stall | 100 @ ~1 s | 10,000 @ ~1 s |
| total samples | 590,100 | 600,000 |
| slow fraction | 0.017% | 1.67% |
| p99.9 | 10 ms | ~1 s |
| p99 | 10 ms | ~1 s |
Closed-loop reports p99.9 = 10 ms. The corrected run reports p99 = 1 s. Same system, same stall, two different stories, and only one of them matches what a user saw.
How tools do it
HdrHistogram has the correction built in: recordValueWithExpectedInterval(value, expectedIntervalBetweenValueSamples). Recording a 1 s sample with an expected interval of 100 µs (10,000/s) makes the histogram insert synthetic samples at 100 µs steps up to 1 s: the ~10,000 arrivals the stall swallowed. That is the arithmetic above, done inside the histogram.
Generators that schedule arrivals independently of completions: wrk2 (-R sets the rate, --latency prints an HdrHistogram), k6's constant-arrival-rate and ramping-arrival-rate executors, Vegeta (-rate, default 50/s), Gatling injection profiles (constantUsersPerSec), JMeter's Precise Throughput Timer.
Failure modes
- Generator can't hold the rate. At 10,000 req/s the schedule interval is 100 µs; a generator that can't schedule that fast silently under-offers. Detect: k6
dropped_iterations> 0, or achieved rate below the target-R. Cost: you are back to closed-loop without knowing it. - Unbounded backlog. If you queue scheduled requests instead of dropping them, the queue grows for the whole stall and you measure queueing delay of a synthetic backlog. Detect: in-flight count or generator RSS climbing monotonically during a stall. Cap in-flight at the concurrency the system is designed for.
- Silent drops. If you drop, count it. A non-zero drop counter means the reported distribution is conditional on the drop policy, and the tail is truncated.
- Wrong expected interval. Correcting with the achieved rate instead of the intended rate reintroduces the bias. Detect: intended and achieved rate should agree to within a few percent.
- Correcting a genuinely closed workload. If production really is 100 users who each wait for a response, closed-loop is the right model and correction overstates latency. Check whether arrivals are independent of completions before you correct.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.