Reducing tail latency in cross-region RPC
When a service spans Seoul, Tokyo and Singapore, the p50 is a comfort and the p99 is the product. We spent three weeks on a payments client whose p99 was 11x its p50, and the cause was not the network โ it was a retry policy written for a single-region world.
What the traces said
Every slow request contained at least one retry, and every retry was issued after a fixed 200 ms timeout. On a link with occasional 300 ms spikes, that timeout fired constantly, tripling load exactly when the link was worst.
# before: fixed deadline, fixed retry
deadline = 200ms; retries = 3
# after: budget-aware
deadline = min(200ms + 2*p95_rtt, remaining_budget)
retries = 1 if elapsed > 0.5 * budget else 2
Replacing the fixed deadline with an RTT-relative one, plus exponential backoff with jitter, cut p99 by 71% with no change to the network path.
The general lesson
Retries amplify whatever is already wrong. Before adding capacity, check whether the system is fighting itself.