What the simulation models
Service A sends 80 requests a second to a dependency, B, which can serve 120. B is a queue in front of a fixed capacity: a request waits for the ones ahead of it, then takes a service time that is usually quick and occasionally slow. If the wait plus the service time passes the client's timeout, the client gives up and moves on.
B doesn't know that. The request is already in its queue, so B still does the work, and then the client sends it again. This is the part that matters. Once B's queue is longer than the timeout, every request it serves is one nobody is waiting for. Its throughput hasn't changed but its goodput is zero, and every failure adds another request to the queue.
Every user request also has a 3-second deadline. A retry that could only start after it is never sent, and a success that arrives after it counts as a failure, because the user has already left.
Metastable failure
The naive policy, three immediate retries, turns each failure into four requests. That is fine while failures are rare. During a fault nearly everything fails, so B sees close to four times the real traffic. When the fault ends, B gets its capacity back, but 4 × 80 is still well over 120. The queue stays full, the timeouts continue, and the retries keep it that way.
The original trigger is gone, but the system stays down anyway, held there by its own recovery mechanism. That is a metastable failure. In production it usually ends only when someone sheds load by hand: restarting clients, blocking traffic, or turning off retries.
The tools
- Timeouts. A timeout below the dependency's p99 turns ordinary slow requests into failures, and with retries, into more load. The slow-dependency scenario is that problem on its own: B never fails a request, and a tight timeout takes it down anyway. Set timeouts from measured latency with some headroom, and inside the caller's own deadline.
- Exponential backoff. Wait longer before each retry, so a client that keeps failing sends less and less.
- Jitter. Backoff alone keeps retries in lockstep. A thousand requests that failed together come back together, as a wave. Randomising each wait spreads the wave out.
- Retry budgets. Cap retries at a share of real traffic. This is the one that stops the multiplication: when nearly everything is failing, the budget runs out and the extra load can't pile up. When failures are rare, there is plenty of budget to retry them.
- Circuit breakers. When most calls are failing, stop making them for a while. That gives the dependency room to drain its queue. But a breaker is blunt: it also fails requests that would have succeeded, and it stays open for its whole cooldown even if the fault has already cleared.
No single policy earns every star. Each scenario rewards a different trade-off. Retries help with short, partial faults and hurt with long, total ones. That is why real clients combine several of these tools instead of relying on any one of them.