Try
↑ ↓ move↵ openesc close
In this lesson · topic 4 of 7
  1. 1. When a retry makes it worse
  2. 2. Backoff, jitter, budgets and breakers
  3. 3. Break a dependency and compare six retry policies
  4. 4. Jitter spreads retries, only budgets and breakers cap them
  5. 5. Hedging the slow tail
  6. 6. Deadlines down the chain, keys across the retry
  7. 7. Sizing the retry safety net

Topic 4

Jitter spreads retries, only budgets and breakers cap them

6 min read

These figures are simulator output averaged over eight seeds, and a test pins each one. Hover a value for its setup. New requests arrive at 0.6 of the dependency’s capacity. It drops to 0.4 of capacity for 40 ticks, and clients make up to four attempts.

The storm in numbers

Policy Attempts per request Busiest 4 ticks Success for requests that began after the incident
No retry 1.0measured 10measured 99%measured
Immediate retries 3.4measured 52measured 0%measured
Backoff with full jitter 3.3measured 35measured 0%measured
Jitter and a retry budget 1.02measured 10measured 98%measured
Jitter and a circuit breaker 0.93measured 10measured 98%measured

The dependency serves 10 attempts a tick when healthy, so a peak near 10 means the dependency is simply fully used. Immediate retries ask for far more than it can give.

Jitter lowers the peak, not the total

Exponential backoff reached a peak of 34measured and full jitter 35measured, against 52measured for immediate retries. That is a real gain: the load arrives more evenly. But the attempts per request barely moved, 3.3measured against 3.4measured. Every request still made nearly every attempt it was allowed. The load is spread out and not reduced, so a dependency that is already behind stays behind. In the lab, jitter alone left the post-incident success at 0%measured.

Jitter earns its keep when clients fail together. With 80 clients waking on the same tick and a lighter background load, the busiest four ticks of retries were 39measured for immediate retries, 22measured for plain backoff and 19measured for full jitter. The gap between backoff and jitter is modest here. In the lab clients mostly start at random times, which already spreads them out, so the effect is smaller than with a real restart or a shared timer.

A ceiling on the load

A budget held attempts per request to 1.02measured, and the breaker to 0.93measured, below one because it refused some requests without sending them. Both let the dependency recover. Ticks from the end of the incident until attempts succeeded again: 25measured with no retries, 30measured with a budget, and 10measured with the breaker. The breaker was quickest because it opened once on average (1.0measured times), sent nothing while open, and let the backlog drain with no new work behind it.

What the breaker costs

A breaker works by refusing. While it is open, every request fails at once, including ones that might have succeeded. That is the point, since sending them is what keeps the dependency down, but it is a decision to fail some users on purpose. Set it too sensitive and a blip opens it. Set it too slow and it opens after the damage. Fast recovery is also not guaranteed: if the probes arrive while the dependency is still down, it reopens for another cool-down.

The breaker in the lab is one shared breaker. A breaker in each client process sees less traffic, each one trips and recovers on its own schedule, and their probes can arrive together.

What a budget costs

A budget caps retries, and a cap can be too low. If the real failure is a short blip in one instance, a tight budget stops retries that would have worked. Size it from the failure rate you expect when things are fine, and let it spend a little more than that.

Further reading

The research term for a failure that persists after its trigger is metastable failure. Bronson and colleagues described the pattern in 2021, and a later study of incidents in real systems found retries to be a common way for the failure to sustain itself.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms