REQUEST HEDGING · TAIL LATENCY
Request hedging: race a backup against a slow primary
Send a backup request when the primary is slow, and weigh the tail latency saved against extra load and duplicate writes.
Event trace
Computed data
Final metrics
Twenty fixed primary latencies (three slow) and twenty independent backup latencies; percentiles use the nearest rank. A write commits 60 ms after it starts and cancellation cannot undo a committed write. The 25% extra-load limit is this drill's policy. Shared-queue effects, where hedges themselves slow the backend, are not modeled.
Hedging everything
Without hedging, the 95th percentile of the twenty requests is 640 ms, set by three slow primaries: 640, 900 and 450 ms. The page opens with Send the backup after 50 ms and a 100% budget. Every primary is slower than 50 ms, so all 20 requests are hedged: p95 drops to 146 ms, but backend requests double: EXCESS LOAD, +100%.
Hedge only the tail
Raise the delay to 130 ms, just above the slowest normal primary at 120 ms. Only requests 6, 12 and 17 are hedged; their backups win at 225, 226 and 233 ms. The p95 falls from 640 to 226 ms for 15% extra requests: TAIL CUT. At 500 ms only requests 6 and 12 are hedged, and request 17 still takes 450 ms: p95 595 ms. A delay of 0 hedges everything again.
Budgets and cancellation
Hedge budget limits how many requests may hedge, in arrival order. At 10% with a 50 ms delay the two hedges are spent on requests 1 and 2, whose primaries win anyway, so p95 stays 640 ms: NO TAIL GAIN. At 130 ms, unticking Cancel the loser when the winner answers keeps the outcome but raises backend work spent on losers from 684 to 1990 ms.
Writes need idempotency
At 130 ms, set Operation to Write without an idempotency key. Each hedged write commits 60 ms after it starts, and cancellation cannot undo it, so requests 6, 12 and 17 each write twice: DUPLICATE WRITES. Write with an idempotency key deduplicates the second commit: TAIL CUT. Untick Hedge slow requests to return to the baseline.
Replay and limits
Any change recomputes the run and rewinds it; the Complete-run preview states the outcome at once. Play and Pause walk through the events, Next event jumps one event, Restart rewinds, Speed runs from 0.25x to 2x and Inspection time seeks from 0 to 60 seconds, where the outcome and final metrics appear. Latencies are fixed, backups are independent of primaries, percentiles use the nearest rank and the 25% load limit is this drill's policy. Hedges slowing a shared backend are not modeled.