Skip to content
gohacks.dev
Architecture

Exponential Backoff Calculator

Plan retry delays with exponential backoff: base delay, multiplier, cap and full, equal or no jitter, with the wait before each retry and the total time spent.

Free · No sign-up · Your inputs stay in your browser

Input

Plan an exponential backoff with jitter

Output

Gives up after 0 ms – 92 s

RetryWait before itElapsed by then
10 ms – 500 ms0 ms – 500 ms
20 ms – 1.0 s0 ms – 1.5 s
30 ms – 2.0 s0 ms – 3.5 s
40 ms – 4.0 s0 ms – 7.5 s
50 ms – 8.0 s0 ms – 16 s
60 ms – 16 s0 ms – 32 s
70 ms – 30 s0 ms – 62 s
80 ms – 30 s0 ms – 92 s

JavaScript (attempt from 0)

const delay = Math.random() * Math.min(30000, 500 * 2 ** attempt);

Laravel job

public function backoff(): array { return [1, 1, 2, 4, 8, 16]; } public $tries = 9;

Laravel's backoff is in whole seconds and has no built-in jitter.

Without jitter, every client that failed at the same moment retries at the same moment, and the retries arrive as a second outage. Full jitter (a random delay between 0 and the exponential value) spreads them best, per the AWS Architecture Blog's comparison. Retry only what is safe to repeat: idempotent requests, or ones carrying an idempotency key.

Runs in this browser. Nothing you paste is sent to a server.

Jitter is not optional

When a dependency fails, all its clients fail at the same instant. Without jitter they all retry at the same instants too, and each wave of retries is a new outage. Full jitter, a random delay between zero and the exponential value, spreads them evenly; the AWS Architecture Blog's Exponential Backoff and Jitter measured the strategies against each other.

Only retry what is safe

Retrying a GET is safe; retrying a payment is safe only with an idempotency key the server uses to recognise the repeat. Retry on timeouts, 429 and 503, not on 400 or 422, which will fail the same way every time.

Share

Frequently asked questions

What is the difference between full and equal jitter?
Full jitter picks a random delay between zero and the backoff value. Equal jitter keeps half the backoff and randomises the other half, so delays never get very short.
How does Laravel do backoff for queued jobs?
A job's backoff property or method returns seconds to wait, either one number or an array with one value per attempt. Laravel adds no jitter itself.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools