Backoff PlannerPlan retries with backoff and jitter.

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

0.00 s8.00 s16.0 s#1#2#3#4#5#6
RetryDelay before itWaited so far, at most
Retry 10.00 s – 0.50 s0.50 s
Retry 20.00 s – 1.00 s1.50 s
Retry 30.00 s – 2.00 s3.50 s
Retry 40.00 s – 4.00 s7.50 s
Retry 50.00 s – 8.00 s15.5 s
Retry 60.00 s – 16.0 s31.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:

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.