Cards/PerformanceSystem Design · Day 76Oct 17, 2026

Ask Twice, Keep The First Answer

A page making twenty backend calls and getting twenty chances to hit a p99, with a second request sent to another replica at the p95 mark pulling the tail from 500ms down to 60ms for about five percent more load

A page making twenty backend calls gets twenty chances to hit a p99. The slow tail becomes the typical experience.

The normal answer is to wait for the straggler and then consider a retry, which is worse than it sounds: the retry only begins after the timeout, so we have already paid the full wait before trying again.

Hedging asks earlier. Send the request, and if nothing has come back by the p95 mark, send a second one to a different replica. Take whichever answers first and cancel the other. On the numbers here, p99 falls from 500ms to 60ms and p95 from 50 to 30.

It works because slowness is usually transient and local — a GC pause, a backlog on one replica, a noisy neighbour on the same machine. Another replica probably isn't having the same bad moment.

The cost is bounded and predictable: hedge at p95 and roughly five percent of requests get duplicated. Three rules keep it safe. Only hedge idempotent reads. Send the second request to a different replica or availability zone. And never hedge a system that is already saturated — doubling requests there is a metastable failure with extra steps.

When the cost of waiting exceeds the cost of asking again, patience is the expensive option.

When the cost of waiting exceeds the cost of asking again, patience is the expensive option.