Services

Resources

Company

Exponential backoff

Exponential backoff is a retry strategy where a client waits longer after each failed attempt, multiplying the delay by a fixed factor. It gives an overloaded or recovering service time to catch up instead of hammering it. Production clients add a maximum delay, a retry limit and random jitter so many clients do not retry at the same moment.

How it works

With a base of 100 ms and a factor of 2, the waits before retries are 100, 200, 400, 800 and 1,600 ms. Five retries add up to 3.1 seconds of waiting. A cap, such as 10 seconds, stops the delay from growing forever. With full jitter, each client waits a random time between zero and the computed delay, so 1,000 clients that failed together spread their retries out instead of returning in one spike.

Why it matters in production

Retries without backoff turn a short outage into a retry storm that keeps the service down after the cause is fixed. Backoff only helps if the operation is safe to repeat, so pair it with idempotency. Retry at one layer only. If each of 3 layers makes 4 attempts, one request can become 64.

See also

On the One2N blog

Further reading

Comic about exponential backoff: 1,000 clients retry the recovered database at once and knock it over; waits of 100, 200, 400, 800 and 1,600 ms with a cap; full jitter spreads the retries below the database limit so it stays up.