A brief failure of a dependency — a timeout, a dropped connection, a 503 response — often goes away on its own: a retry a second later reaches a service that has already recovered. But a retry without a delay adds load to a dependency that is already overloaded — this is how a retry storm starts. A growing delay gives the failing service room to breathe, and a cap on attempts keeps the client from retrying forever.
How the delay grows
The delay is computed from the attempt number: the base interval is multiplied by a base, most often 2, which produces a geometric progression. Growth is limited by a ceiling, otherwise the tenth attempt would have to wait for minutes.
| Attempt | Formula | Example: a base of 100 ms |
|---|---|---|
| 1 | 100 ms × 2⁰ | 100 ms |
| 2 | 100 ms × 2¹ | 200 ms |
| 3 | 100 ms × 2² | 400 ms |
| 4 | 100 ms × 2³ | 800 ms |
| 5 | 100 ms × 2⁴ | 1.6 s |
| 6 | 100 ms × 2⁵ → ceiling of 2 s | 2 s |
Jitter
Without a random addition — jitter — clients that have come through the same failure compute identical delays and retry in synchronised waves: each wave hits the dependency again, and it cannot recover. Jitter spreads the attempts out in time; at Amazon it is added not only to retries but also to timers and periodic jobs. The variants: full jitter — the delay is uniformly random from zero to the computed value; equal jitter — half of the delay is fixed, the other half is random; decorrelated jitter — the maximum of the next delay grows from the last random value.
What else is limited
- the number of attempts — usually 3–5, after which the error is handed back to the calling code; in gRPC a policy of more than five attempts is capped at five anyway;
- which errors to retry — timeouts, dropped connections and the status codes 429 and 503; a 429 response may carry a
Retry-Afterheader saying how long to wait — it takes precedence over the client’s own calculation; - the retry layer — one only: AWS cites an example of a stack of five calls with three attempts in each — the multiplication of attempts raises the load on the database 243-fold;
- retry safety — the operation must be idempotent or carry an idempotency key, otherwise a retry will create a second payment or a second order.
Example
retryPolicy: maxAttempts: 5 initialBackoff: 0.1s maxBackoff: 2s backoffMultiplier: 2.0 retryableStatusCodes: [UNAVAILABLE]Sources
the term is written from these pages- AWS Builder Center — Timeouts, retries, and backoff with jitterbuilder.aws.com/content/3EumjoZascWd1oZiEgL8ORlv3qE/timeouts-retries-and-backoff-with-jitter(opens in a new tab)
- AWS Architecture Blog — Exponential Backoff and Jitteraws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/(opens in a new tab)
Verified 8 Nov