Backoff and Jitter Playground
Adjust an exponential backoff schedule and watch what happens when two dozen clients retry at once — with and without randomness.
When a server falls over, every client that was talking to it times out at roughly the same moment. If they all retry on the same schedule, they all come back at the same moment too.
This experiment computes retry delays for 24 simulated clients that failed simultaneously. The top strip shows plain exponential backoff; the bottom strip applies the jitter mode you choose. Each row is one client; each mark is one retry.
| Retry | Ceiling | Delay | Fires at |
|---|---|---|---|
| 1 | 200 ms | 2 ms | 2 ms |
| 2 | 400 ms | 25 ms | 27 ms |
| 3 | 800 ms | 782 ms | 809 ms |
| 4 | 1.6 s | 1.1 s | 1.9 s |
| 5 | 3.2 s | 1.7 s | 3.6 s |
| 6 | 6.4 s | 2.6 s | 6.2 s |
The schedules
For retry number (counting from zero), with base delay , multiplier and cap , the exponential ceiling is
The three modes then choose the actual delay as follows, where is a uniformly random value between and :
| Mode | Delay before retry |
|---|---|
| None | |
| Equal | |
| Full |
Without jitter, every client computes the same , so the “most retries within” count equals the number of clients: each wave of retries arrives at once. Any randomness spreads them out; full jitter spreads them the most, at the cost of some clients retrying sooner than the ceiling.
Notes on the experiment
- Randomness comes from a seeded generator, so the server-rendered page and the interactive version agree, and “draw new random delays” is reproducible.
- The simulation is deliberately simple: it ignores request duration and whether retries succeed.
- Spreading retries out only helps if repeating a request is harmless — the subject of Idempotency, and Why Retries Need It.