Chapter 1 showed why a busy server gets slow; Chapter 2 showed how to measure it honestly. This chapter is about what happens when one user request touches dozens or thousands of those servers: rare leaf events become routine, the root SLO quietly turns into a leaf SLO four nines deep, and the fixes — hedging, tying, deadlines — each have a failure mode that makes an incident worse if you apply them without knowing which kind of variance you have.
The arithmetic is from Dean and Barroso's The Tail at Scale (CACM, 2013): if a leaf is slow 1% of the time and a root request waits for 100 leaves, the root is slow 1 − 0.99¹⁰⁰ ≈ 63% of the time. Everyone has seen that number. What is less often internalised is the inverse, which is the number you actually design to. For a root percentile target P over N independent leaves, each leaf must meet P^(1/N). A root p99 over 100 leaves is a leaf p99.99. A root p99.9 over 1,000 leaves is a leaf p99.9999 — ten slow responses per million, which most teams cannot even measure per leaf, let alone hold.
Assumes leaf slowness is independent. Fully correlated slowness (a shared dependency, a synchronized cron) does not climb this curve: it hits every root at once whatever N is, and, as 3.2 argues, it is also the part hedging cannot touch.
The same paper reported measurements from a Google service in which a single leaf's p99 was around 10 ms while the p99 for all leaves of a request to finish was around 140 ms, and waiting for the slowest 5% of leaves accounted for roughly half of that. That last observation is the useful one: the root's tail is not driven by the average leaf, or even the slow leaf, but by the last few stragglers, and whatever you do has to target them specifically.
At N=100 you have roughly 100 slow leaf responses per million to spend. Most teams cannot even measure p99.99 per leaf with confidence; the histogram needs hundreds of thousands of samples per window before that bucket means anything (Chapter 2).
Three consequences that tend to be missed in design review:
Architect's note · independence is the load-bearing assumption
A leaf's latency distribution is rarely one smooth curve. It is a fast mode — the work itself — plus a set of interference modes, each with its own magnitude and rate: a pause, a stall, a retransmit, a throttle. The table below classifies them by the property that decides the mitigation, not by subsystem.
The dividing line is independence. A second attempt only helps if it draws from a different, uncorrelated distribution. The bottom two rows are where teams add hedging and make the incident worse.
Most of these are covered elsewhere in the track — queueing in Chapter 1, collectors and allocation in Chapter 5, cache cold starts in Chapter 6 — so here are the two that produce the most confusing incidents because nothing on the dashboard looks wrong.
CFS bandwidth throttling. A Kubernetes CPU limit is implemented as a CFS quota over a period, 100 ms by default. A limit of 2 cores means 200 ms of CPU time per 100 ms of wall time, summed across all threads in the cgroup. A process with 8 runnable threads — a thread pool sized to the host's cores, a GC with parallel workers, a burst of concurrent requests — can spend the entire quota in 25 ms of wall time and then sit throttled for the remaining 75 ms. Every request that arrives in that window waits for the next period, whatever its own CPU need.
The average utilisation is low, so autoscalers do nothing, and CPU dashboards show headroom. The only direct evidence is the nr_throttled and throttled-time counters in cpu.stat (throttled_time in cgroup v1, throttled_usec in v2), which few teams alert on. Utilisation sampled at 10–60 s resolution cannot see a 25 ms burst; the ratio nr_throttled / nr_periods can. The signature in a latency histogram is a shelf of added delay with a hard ceiling at one period minus the burst time, independent of request size, which is distinctive once you know to look for it. The fixes, in order of preference: remove CPU limits for latency-sensitive services and rely on requests for scheduling (a defensible default on dedicated node pools); size thread pools and GC worker counts to the quota rather than the host, which is a runtime setting covered in Chapter 5; or shorten the period, which reduces the maximum stall at the cost of more scheduler overhead. Newer kernels also offer a burst allowance for bursty-but-light workloads. Older kernels had a slice-expiry bug that throttled containers well below their quota; if you run anything old, verify before tuning.
TCP retransmission timeouts. Linux's default minimum RTO is 200 ms, and the initial RTO for a SYN is 1 s. Tail loss probe (and RACK) rescues most lost tails of multi-packet flights within a couple of RTTs, which is why this mode is less common than it used to be — but with a single packet in flight, the typical small RPC request or response, Linux pads the probe timer by roughly the minimum RTO to allow for a delayed ACK, and a lost retransmission falls back to the RTO with exponential backoff. So a one-packet RPC that loses its packet still pays on the order of 200 ms. At illustrative loss rates of 0.01–0.1% on a busy link and a few packets per call, that alone produces a clean mode at +200 ms in the p99.9, and a separate mode at +1 s for calls that had to open a new connection. The tells are exact: modes at 200 ms and 1 s above the fast mode, independent of load, correlated with a specific rack or path. Warm connection pools remove the SYN mode; a hedge delay well under 200 ms makes the RTO mode irrelevant, because the second attempt almost always travels on a different flow. Lowering rto_min per route (ip route … rto_min) is the other lever inside a datacenter, with the usual caveat that spurious retransmits rise if you set it below real RTT variance.
Pitfall · request-intrinsic cost is not variance you can hedge
In practice the classification is done from data you already have, not from intuition. Four splits over a day of traces separate almost every tail: slow-call rate by replica (one host or all?), by key or tenant (does the slowness follow the request?), by root request (given one slow leaf, is a second leaf in the same fan-out more likely than baseline to be slow?), and by time bucket against utilisation (does it scale with load, or sit at a fixed offset?). The conditional-probability split is the one teams skip and the one that matters most. If P(leaf slow | sibling slow) is several times P(leaf slow), the fan-out math in 3.1 overstates your root tail, and hedging will buy less than the model promises, because the second attempt is drawn from the same bad moment.
Colour = how independent the slowness is across replicas: independent, partly, follows the request or the fleet. The last two rows are where duplicate attempts spend capacity during the exact incident they were meant to fix.
A hedged request sends the call to one replica; if no response arrives within a delay d, it sends the same call to a second replica, uses whichever answers first, and cancels the other. Setting d at the leaf's p95 caps the extra load at 5% by construction, because only calls that have already exceeded d get a second attempt. Dean and Barroso report a BigTable benchmark in which hedging after 10 ms cut the p99.9 for reading 1,000 keys across 100 servers from 1,800 ms to 74 ms, for about 2% more requests.
Beyond d the hedged survival is the product S(t)·S(t−d). Squaring a 2% slow mode gives 0.04%, which is why a few percent of extra load buys an order of magnitude at p99.9 — provided the two attempts are independent.
The mechanism is visible in the diagram. Past d, the hedged latency is min(X₁, d + X₂), so its survival function is the product S(t)·S(t−d). A slow mode of probability 2% becomes a slow mode of 0.04%. What the product does not do is move the floor: the hedged p99 can never be below d plus a fast response. That gives the rule for choosing d. Put it just past the knee where the fast mode ends and the interference modes begin. Earlier than that and you pay load for calls that were about to finish; later and you wait for no reason. On a bimodal leaf, the knee is obvious in a log-scale survival plot; on a leaf without a clear knee, hedging gains less than the headline numbers suggest.
The failure modes are where the architecture lives:
The saturation bullet above deserves a sharper version, because the one-step arithmetic ("30% extra at ρ = 0.8") understates it. The extra load raises utilisation, which raises the crossing rate, which raises the load again. The operating point is the fixed point of ρ = ρ₀(1 + h(ρ)). In the same M/M/1 model with d calibrated at ρ = 0.5, that fixed point stops existing at a base utilisation of about 0.62. Above it, a delay-only hedge policy with uncancelled losers has no stable state short of saturation, so a service that ran comfortably at 0.6 falls over after a 5% traffic bump. A 5% hedge budget turns the same policy into a benign +5% until close to 0.95. The exact knee depends on the service-time distribution, and a heavier fast mode moves it. What doesn't change is that there is a cliff, it sits well below the utilisation your capacity plan assumes, and you only find it on the day a dependency slows down.
≤ P(X > d)
extra load from hedging
d + fast
floor of hedged latency
S(t)·S(t−d)
hedged tail past d
per-attempt
where d must be measured
Hedging pays a delay d before it helps. If the dominant source of variance is queueing — requests waiting behind others on a busy replica — you can do better by enqueueing on two replicas at once and cancelling the loser before it runs. That is the tied request from the same paper: each copy carries the identity of its twin, and whichever replica dequeues it first sends a cancellation to the other, which drops its copy while it is still queued. Duplicate execution is close to zero, because cancellation happens at the one point where it is cheap. The paper notes a subtlety: if both replicas are idle, both may dequeue at once and both execute, so the client staggers the second copy by roughly two network one-way delays to let the first cancellation arrive.
The decision between them follows from 3.2. Tied requests target queue time: they are nearly free and help from the first millisecond, but do nothing if the variance happens during execution — a GC pause or a throttling stall after dequeue. Hedging targets everything independent, including execution-time interference, but costs d. Systems with deep, bursty queues and stable service times want tying; systems with short queues and noisy execution want hedging; many want both. Tying also needs server cooperation — a cancel path that reaches into the queue — which rules it out for a lot of off-the-shelf backends. Hedging needs only the client.
Tying generalises into load balancing, which is where most of the practical wins come from. If the problem is "which replica has the shorter queue", you can ask before sending instead of sending twice. Power of two choices (pick two replicas at random, send to the less loaded) turns the maximum load across n servers from roughly log n / log log n to log log n in the classic balls-into-bins analysis — an exponential improvement from one extra sample. Twitter's Finagle combines it with a peak-sensitive EWMA of latency, so a replica that just had a pause is avoided immediately rather than after a moving average catches up. Why two random choices and not simply "the least loaded"? Because every client's view of load is stale. With many clients picking the globally least-loaded replica from information a few milliseconds old, they all pick the same one, and it oscillates from idlest to most overloaded — Mitzenmacher's analysis of old information shows join-the-shortest-queue can do worse than random under staleness, while two random choices stays robust because the randomness breaks the herd. The other point people miss: round-robin is worst for tails precisely when a replica is intermittently slow, because it keeps sending that replica its exact share during the pause. Least-outstanding-requests or P2C with a latency signal is one of the cheapest tail reductions available, and it requires nothing from the server.
Decision rule
A timeout is a local statement ("I will wait 1 s"); a deadline is a global one ("this work is worthless after 14:03:07.820"). Timeouts configured per hop do not compose. Four tiers with a 1 s timeout and three attempts each produce up to 27 attempts at the bottom per user click, and a mid-tier can still be retrying seconds after the user has given up. The work continues, consumes capacity, and is thrown away — exactly during the overload that made things slow in the first place.
Static timeouts + retries at every layer
edge
1 s timeout · 1 attempt
A → B
1 s timeout · 3 attempts
B → C
1 s timeout · 3 attempts
C → D
1 s timeout · 3 attempts
D sees up to 3³ = 27 attempts per user click; C keeps retrying D for up to ~3 s, long after the edge gave up at 1 s
Propagated deadline · 800 ms budget
The mechanism that fixes it is small: the edge sets one deadline, every hop propagates remaining time (not an absolute timestamp — clocks disagree, which is why gRPC sends a relative timeout on the wire and converts it to a local deadline on receipt), and every hop derives its own timeouts from what remains. Three rules make it work in practice:
The second-order effect is on measurement. Once deadlines are propagated, a slow hop no longer shows up as its own latency spike; it shows up as deadline-exceeded errors in whatever runs after it — a sibling call later in the sequence, or a service two hops away that inherited a budget with nothing left in it. Tag every cancellation and deadline error with the hop that consumed the most budget, or the post-incident trace will blame the service that ran out of time instead of the one that spent it. The Distributed Systems Deep Dive track's treatment of timeouts and failure detection is the theory behind this; here the point is that the budget is a latency-engineering artefact and should be designed with the fan-out, not left to per-client defaults.
Pitfall · retries at every layer
Given a quarter of engineering time, most teams optimise the fast path: a faster serializer, a better index, fewer allocations. That lowers the mean, and it is the wrong target in two common regimes. The table makes the fan-out case concrete. With a leaf that is slow 0.5% of the time, making the fast mode 30% faster wins at N=1 and at the median of narrow fan-out. By N=10 the root p99 is determined entirely by the slow mode, and by N=200 so is the median. Capping the slow mode wins by 5× in both, and the mean optimisation is invisible at the root.
P(no slow leaf) = 0.995^N: 95% at N=10, 37% at N=200. Once that falls below the percentile you care about, the root percentile is the slow mode, and making the fast mode faster is invisible. Values ignore the small max-of-N lift within the fast mode.
The queueing regime is subtler. Kingman's approximation (Chapter 1) makes queue wait proportional to (ca² + cs²) / 2 — the squared coefficients of variation of arrivals and service — times ρ/(1−ρ) times mean service time. Take an illustrative service at ρ = 0.8, Poisson arrivals, and service-time cs = 2 (heavy but not unusual). Mean wait is about 4 × 2.5 = 10 service times. Now compare two options:
The general statement: mean reductions buy latency through utilisation, and utilisation is fungible with money, so the organisation tends to spend it. Variance reductions buy latency at a given utilisation, which is also what lets you run hotter safely. The capacity model in Chapter 7 is where this becomes a budget line: every unit of cs² you remove raises the utilisation you can run at for the same p99.
Variance reduction also looks different from speed work, which is part of why it gets skipped. The highest-yield moves are usually structural: bounding work per request (page sizes, result caps, query cost limits, so the longest request is at most a small multiple of the median); separating size classes into different queues or pools, so a 2 s export never sits in front of a 5 ms read; making background work (compaction, snapshotting, cache refresh) rate-limited and interruptible; removing CPU limits that throttle; and removing synchronisation — the TTL that makes every cache entry expire at the same second, the cron at minute zero on every host.
Decision criteria
Dean and Barroso's most durable framing is that you build tail-tolerant systems out of components that will always have tails, in the same way fault-tolerant systems are built from unreliable parts. Hedging and tying are two techniques; the rest are architectural and have to be decided early because they shape the data model.
max_ejection_percent is the model), and judge "slow" relative to the peer median, never against an absolute threshold.The k-of-N lever is steeper than intuition suggests, and it gives the most per unit of product cost of anything in this chapter. The chart puts numbers on the good-enough-results bullet. It also shows why the policy should be stated as "drop at most k" rather than "return at the deadline with whatever arrived". The deadline form has no floor on completeness, so a correlated slowdown quietly turns into 60%-complete results served at a healthy-looking p99.
Dropping two stragglers at N=100 relaxes the leaf from 1-in-10,000 slow to about 1-in-230, a ~44× looser target. Each extra drop is worth less than the one before, while the cost (a missing 1% of the corpus per drop) is linear. The first one or two drops are where nearly all the value is.
Questions to ask in a design review
63%
roots slow at N=100, leaf 1%
P^(1/N)
leaf target for root P
~20
partitions / machine (Dean & Barroso)
k-of-N
partial results beat max(N)
Where next