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

Four-panel comic about Exponential backoff: The database comes back after 5 minutes and 1,000 clients retry at the same instant. It falls over again; Exponential backoff doubles the wait after each failure, with a cap and a retry limit; Waits of 100, 200, 400, 800 and 1,600 ms add up to 3.1 s...