Skip to content

DeploymentInteractive lab

Latency budget

Assemble a request path from real hardware numbers

Build a request out of cache hits, disk reads, network hops and cross-region calls, and see where the budget actually goes - serial versus parallel, p50 versus tail.

What this teaches

  • Latency numbers
  • Serial vs parallel cost
  • Tail amplification

The request path

4 stages · 56 calls

What the path costs

p99 from summed distributions
2.4 ms
Total at p50
3.6 ms
Total at p99
4.4 ms
If you added the p99s
43.0%
Requests touching a slow call

This path costs 2.4 ms at the median and 3.6 ms at the 99th percentile, across 56 calls, of which 43.0 percent of requests touch at least one slow one.

43.0% of requests touch at least one p99-slow call. That is 1 - 0.99^56, and it is the whole argument for caring about the tail. A dependency that is slow one time in a hundred is not a rare event once a request makes 56 of them. At 100 calls it is 63.4% - the tail stops being an edge case and becomes the common case.

The third tile is the mistake this page exists to price. Adding per-stage p99s assumes every stage has its bad day on the same request, which is 22% pessimistic here. Summing the means and the variances and reading the percentile off the result is the right arithmetic, and it is what the second tile does.

Where the budget goes

bar length is the p50 share
Each stage of the path with its median and tail contribution.
StageModeCallsp50p99Share of p50
Round trip within a datacentreserial1500.0 us2.0 ms20.4%
Round trip within a datacentreparallel501.9 ms4.1 ms76.0%
SSD random readserial477.5 us201.5 us3.2%
Send 1KB over 1Gbpsserial110.0 us40.0 us0.4%

A parallel stage costs the SLOWEST of its calls, not their sum, and the arithmetic for that is exact rather than simulated: the p-th percentile of the maximum of N independent draws is the p^(1/N)-th percentile of one draw. So the median of a 50-way fan-out is already the p98.6 of a single call. Fanning out does not remove the latency, it converts your median into somebody else's tail.

What is real here, and what is standing in

Real: the distribution fitting, the serial sum over means and variances, the exact parallel-maximum percentile, and the tail-amplification figure are all computed on this page from the constants shown. The inverse-normal function is a numerical method written out in the file, not a lookup table.

Standing in: the constants are published order-of-magnitude figures in the "latency numbers every programmer should know" lineage, not measurements of your hardware, and the per-operation p99s are illustrative - a real one comes from your own histogram and it is the input that moves the answer most. The log-normal shape is an assumption: real service latency is often bimodal, with a GC pause or a connection-pool wait forming a second hump this cannot draw. And the stages are treated as independent when in reality they queue behind the same CPUs and the same pool, so their slow moments arrive together.

Both of those last two push the same way. The p99 on this page is an optimistic number. If it tells you the budget is tight, it is tighter than that.

Everything on this page runs in your browser. Nothing you type is sent anywhere, there is no account, and it keeps working offline.