Retry backoff calculator
See when each retry of a failed request would happen with exponential backoff, how much random jitter spreads the retries out, and how long a caller waits in the worst case before giving up.
Policy
Worst-case total wait before the last retry: 0.00 s – 31.5 s
Retry schedule
| Retry | Delay before it | Waited so far, at most |
|---|---|---|
| Retry 1 | 0.00 s – 0.50 s | 0.50 s |
| Retry 2 | 0.00 s – 1.00 s | 1.50 s |
| Retry 3 | 0.00 s – 2.00 s | 3.50 s |
| Retry 4 | 0.00 s – 4.00 s | 7.50 s |
| Retry 5 | 0.00 s – 8.00 s | 15.5 s |
| Retry 6 | 0.00 s – 16.0 s | 31.5 s |
Why back off, and why jitter
When a server is overloaded or rate limiting, retrying immediately makes things worse. Exponential backoff waits longer after every failure: the delay before retry n is the first delay times the multiplier to the power n − 1, up to a ceiling. If many clients failed at the same moment, they would still retry at the same moments, so a random part, the jitter, is added to spread them out:
- None: exactly the computed delay. Simple, but clients stay in step.
- Full jitter: a random delay between zero and the computed delay. Spreads retries the most.
- Equal jitter: half the computed delay plus a random part up to the other half, so there is always some wait.
- Decorrelated jitter: each delay is random between the first delay and three times the previous one, capped at the ceiling. The multiplier setting is not used.
Honour Retry-After
A 429 or 503 response may carry a Retry-After header. HTTP (RFC 9110) defines its value as either a
number of seconds or an HTTP date. When it is present, wait at least that long instead of the computed delay.
What to retry
Retry timeouts, connection resets and responses such as 408, 429, 500, 502, 503 and 504. Do not retry errors that will not change, such as 400, 401, 403 or 404. A POST that failed after reaching the server may already have been processed; retry it only when the API offers an idempotency key or the operation is safe to repeat. Always stop after a fixed number of retries and report the error.