Tail Latency & Fan-out Amplification — Why p99 Is the Number
The average is a liar — design for p99
"Average latency is 20ms" tells you almost nothing about user pain. A few percent of requests being slow (the tail, p99/p99.9) is what users actually feel — and at scale, a single user action often triggers many backend calls, which makes the rare tail the common case. This is the mental model behind Dean & Barroso's "The Tail at Scale."
The fan-out math (memorize this)
A request that fans out to N backends is only as fast as its slowest one. If each backend is slow 1% of the time (its p99):
P(at least one slow) = 1 − 0.99N. For N=100 → ~63%. For N=1 it's 1%.
So a "1-in-100 rare" tail latency becomes the majority experience once you fan out to 100 services or shards. Your service's p99 is dominated by your dependencies' tails, not their averages.
| Fan-out N | P(≥1 leaf slow) = 1 − 0.99N | What it means |
|---|---|---|
| 1 | 1% | the leaf's own p99 |
| 10 | ~9.6% | your leaf p99 is your composed p90 |
| 30 | ~26% | a quarter of user requests touch the tail |
| 100 | ~63% | the "rare" tail is the majority experience |
The reusable rule: fan-out shifts the percentile, roughly by a factor of N. To hold a composed p99 across N=10 leaves, each leaf must hold roughly a p99.9 at the target latency — an SLO on the whole is an order-of-magnitude stricter SLO on every part.
What to do about tails
- Measure percentiles, not averages — p50/p95/p99/p99.9. Alert on the p99 of the composed fan-out request, not only each leaf: every leaf can look healthy at its own p99 while the 1−(1−p)N composition still blows the user-facing p99.
- Hedged / backup requests: if a call exceeds p95, send a duplicate to another replica and take the first to return. A p95 hedge adds up to 5% extra load (1000 QPS → ~50 duplicate QPS), more if the first call is cancelled late. Do not hedge non-idempotent or stateful writes, and do not hedge when the downstream is already the bottleneck — the extra load widens the tail it tries to fix (Dean & Barroso, "The Tail at Scale," CACM 2013).
- Reduce fan-out or make it parallel with a budget; cap the slowest with timeouts + fallbacks.
- Attack the causes of tails: GC pauses, cold caches, queueing, a hot shard, contention. Mostly queueing: wait time scales like 1/(1−utilization), so a server at 99% utilization waits ~50× longer than one at 50% — which is why load-shedding and capacity headroom are tail-latency tools, not just throughput tools.
When hedging is the wrong choice
Hedging is not free. If your downstream service is already at 95% utilization, a 5% hedge can push it into saturation,
making the tail worse for everyone. It also amplifies correctness risk: hedging a POST /charge can create two
charges if the first request actually succeeded but its response was merely slow. Hedge idempotent reads
(query, cache lookup) whose duplicates are harmless; avoid hedging non-idempotent writes (charge, transfer,
email send) unless you have a strong idempotency contract.
Tied requests — the cheaper refinement from the same paper
Hedging waits for the p95 then duplicates; tied requests skip the wait: dispatch the request to two replicas immediately, each carrying the identity of its twin, and whichever server starts executing first sends a cancel to the other. Because the cancel fires at start-of-execution (while the loser is still queued), the duplicate rarely does real work — Dean & Barroso report only a few percent extra work with cancellation, versus hedging's full duplicate past the p95. Tied requests beat hedging when queueing (not service time) dominates the tail: there is no p95 wait, so the whole distribution improves, and duplicate work stays bounded. The cost: your RPC layer must support cross-server cancellation, which most off-the-shelf HTTP stacks don't (Dean & Barroso, "The Tail at Scale," CACM 2013).
The mental model
Whenever you see fan-out (scatter-gather, microservice graphs, sharded reads), think: "my latency = the worst of N, not the average of N." Design the tail down.
Takeaways
- Averages hide pain; users feel the tail (p99/p99.9) — measure and alert on percentiles.
- Fan-out amplifies tails: 1% slow × 100 calls ≈ 63% of requests slow.
- Tame with hedged requests, timeouts/fallbacks, less fan-out, and fixing tail causes (GC, hot shards, queueing).
Re-authored for this guide; fan-out diagram hand-authored as SVG. Follows Dean & Barroso, "The Tail at Scale" (CACM 2013). See also: Capacity Estimation (latency numbers), Load Balancing (power-of-two), Designing for Failure.
🤖 Don't fully get this? Learn it with Claude
Stuck on Tail Latency & Fan-out Amplification — Why p99 Is the Number? Open Claude, copy a block below, and it'll teach you this exact concept — visually and interactively.
Build the mental picture, not memorization.
I just read a lesson on **Tail Latency & Fan-out Amplification — Why p99 Is the Number** (System Design) and want to truly understand it. Explain Tail Latency & Fan-out Amplification — Why p99 Is the Number from first principles using ONE vivid real-world analogy and a visual mental model — draw it as ASCII art or a clear step-by-step diagram — with a concrete example using real numbers. Then ask me one question to check I got the mental picture, and wait for my reply. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
Socratic — adapts to where you're stuck.
Teach me **Tail Latency & Fan-out Amplification — Why p99 Is the Number** interactively. Ask me ONE guiding question at a time, wait for my answer, and adapt to my confusion — build the idea with me step by step instead of explaining it all at once. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
Active recall exposes what you missed.
Quiz me on **Tail Latency & Fan-out Amplification — Why p99 Is the Number** with 5 questions, easy to tricky, ONE at a time. Tell me if each answer is right; at the end, explain clearly what I got wrong and why. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
Intuition + hook + flashcards for long-term memory.
Help me remember **Tail Latency & Fan-out Amplification — Why p99 Is the Number** for the long term: give the one-sentence intuition, a memorable hook/mnemonic, a tiny worked example, and 3 active-recall flashcards (Q -> A). If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.