Problem
In a fan-out system a small fraction of slow responses dominates overall latency, because the slowest call determines the result. Slowness is often transient and specific to one replica, such as a GC pause or noisy neighbor.
Also known as: backup-requests, speculative-retry
Cut tail latency by sending a duplicate request to another replica when the first has not answered within a short delay.
In a fan-out system a small fraction of slow responses dominates overall latency, because the slowest call determines the result. Slowness is often transient and specific to one replica, such as a GC pause or noisy neighbor.
Hedged requests, described in Google's work on tail latency, treat slowness as a probabilistic event. Rather than waiting for a slow replica, the client races a second attempt.
The client issues the first request, waits for a hedge delay, then issues a backup to a different replica. The first successful reply wins and the other is cancelled.
t=0 send to replica A
t=95ms no reply yet (p95), send to replica B
t=110ms B replies, cancel A, return result
A good hedge delay is the observed p95 or p99 of the operation. A token bucket limits the share of hedged traffic, for example ten percent of requests, so the mechanism cannot run away. Servers that support cancellation stop work early, which keeps the cost close to the duplicate-rate.
Low to medium, around five percent extra requests
Medium, tune delay and budget
Medium, concurrency and cancellation
Hedging during overload doubles traffic and deepens the outage
Non-idempotent operation executed twice
Both replicas slow for the same reason, so hedge adds load without benefit