How it works · 23 of 49 Core
How should timeouts, retries and exponential backoff work, and what is a retry storm?
And the retry storm
Timeouts, retries & backoff: A timeout decides when to give up on a call; a retry tries again. Retries help when failures are brief and rare, and hurt when many callers fail together: they all come back at the same moment, a wave bigger than the server can take, and knock it over again. Backoff (wait longer after each failure) spaces the waves out but keeps them synchronised; jitter (a random part in every wait) spreads them into a steady drizzle the server can serve. Retry at one layer, with a budget, and only calls that are safe to repeat.
Loading the animation…
Say it like this When many callers fail together, retries return as synchronised waves that knock the server down again; backoff spaces the waves, jitter spreads them into a load the server can serve, and retrying at one layer with a budget keeps it from multiplying.
Under the hood — for builders
- The sources, in their words
- Marc Brooker ("Exponential Backoff And Jitter", AWS Architecture Blog, 2015): backoff alone "helps a small amount, but doesn't solve the problem"; "there are still clusters of calls"; jittered backoff "should be considered a standard approach for remote clients." Brooker ("Timeouts, retries, and backoff with jitter", Amazon Builders' Library, 2019): "when a client retries, it spends more of the server's time to get a higher chance of success."
- Run here: the scene's numbers
- Backoff: wait 0.1 s × 2ⁿ after the nth failure, capped at 10 s. Jitter: a random part of that wait (half jitter keeps half fixed; full jitter draws the whole wait at random). 1,000 callers fail at t = 0; the server serves 100 calls per 0.1 s and falls over for 1 s when a window gets more than 150:
- Retries multiply across layers
- Brooker (2019): with five layers each retrying three times, "the load on the database will increase 243x, making it unlikely to ever recover."
- Picking the timeout
- Brooker (2019): choose an acceptable rate of false timeouts, "such as 0.1%", and set the timeout at that latency percentile of the service called (p99.9).
- Retry budgets
- A token bucket: each retry spends a token, tokens refill slowly, so under a wide outage retries stop instead of piling up. Brooker: "This allows all calls to retry as long as there are tokens."
- Safe to repeat
- Brooker: "APIs with side effects aren't safe to retry unless they provide idempotency": send a request id the server remembers (as D5's warehouse does).
- Measure it
- Retries per call · calls arriving per 0.1 s after a failure · time from recovery to normal · layers that retry.
- Watch out
- Which jitter wins depends on the load: here half jitter finished first; in Brooker's 2015 simulation full jitter did less work. Any jitter beats none.
- Sources
- Marc Brooker, "Exponential Backoff And Jitter", AWS Architecture Blog, 2015 (updated 2023) · Brooker, "Timeouts, retries, and backoff with jitter", Amazon Builders' Library, 2019 · both read in session · retry simulation, Python, 19 Nov 2026.
What happens in the timeouts, retries & backoff animation, step by step?
- The server restarts for a second. All 1,000 callers fail at once, and every one of them retries.
- Retry at once: the callers come back together, ten times what the server can take, and knock it down again. And again.
- Backoff waits longer after each failure. The waves are spaced out, but each still arrives all at once and knocks it down.
- Your turn: drag the slider below the picture to add jitter, a random part to each wait.
- With jitter the waves smear into drizzle under the limit line: the server stays up and all 1,000 are served.
- Retries multiply across layers. Retry at one layer, with a budget, and only calls safe to repeat. Next: stop calling what is down.
What everyday example explains timeouts, retries & backoff?
Everyone redialling a busy line at once. If each caller waits a random while before redialling, the line clears.
Why should a team care about timeouts, retries & backoff?
Most outages that "fixed themselves, then came back" are retry storms: the service recovers and its own callers knock it down. Every SDK default, every agent loop and every queue consumer that retries is part of the load plan.