Lab · Reliability
Retries, backoff & jitter
Retrying a failed request is the simplest fix for transient errors — and a classic way to take down a struggling service. Compare retry policies during an outage and a traffic spike, and watch how much extra load each one creates.
Try it
- Clients — Exponential backoff — healthy — 18 new requests/s
- Service — handles up to 30 requests/s — healthy — receiving 21/s
- Request
- Retry
- Response
- Error / rejected
Numbers add up:70 requests = 64 succeeded + 0 gave up + 6 in progress; 72 attempts = 70 first tries + 2 retriesThe lab checks this sum as it runs, so a counting mistake would show here.
Controls
Show data table
| Time | First attempts | Retries |
|---|---|---|
| 1s | 30 | 0 |
| 1s | 32 | 0 |
| 2s | 30 | 0 |
| 2s | 16 | 2 |
| 3s | 20 | 0 |
| 3s | 12 | 2 |
Recent retried requests
What just happened
Nothing yet. Start traffic or run an experiment.
Compare two retry policies through the same outage
Both sides get the same new requests at the same moments, and the service fails on both from 8 s to 12 s. Only the retry policy differs, so any gap comes from the policy. Both sides start with 20 seconds already run.
Wait 250 ms, 500 ms, 1 s… before each retry.
Wait a random time between 0 and the backoff, so clients spread out.
- Clients — Exponential backoff — healthy — 18 new requests/s
- Service — handles up to 30 requests/s — healthy — receiving 22/s
Show data table
| Time | First attempts | Retries |
|---|---|---|
| 1s | 30 | 0 |
| 1s | 32 | 0 |
| 2s | 30 | 0 |
| 2s | 16 | 2 |
| 3s | 20 | 0 |
| 3s | 12 | 2 |
| 4s | 14 | 0 |
| 4s | 22 | 0 |
| 5s | 20 | 2 |
| 5s | 14 | 0 |
| 6s | 18 | 4 |
| 6s | 24 | 0 |
| 7s | 8 | 0 |
| 7s | 18 | 0 |
| 8s | 14 | 0 |
| 8s | 18 | 0 |
| 9s | 12 | 4 |
| 9s | 20 | 14 |
| 10s | 14 | 30 |
| 10s | 20 | 34 |
| 11s | 20 | 40 |
| 11s | 12 | 56 |
| 12s | 38 | 46 |
| 12s | 8 | 60 |
| 13s | 20 | 54 |
| 13s | 10 | 50 |
| 14s | 12 | 12 |
| 14s | 18 | 28 |
| 15s | 20 | 4 |
| 15s | 22 | 2 |
| 16s | 16 | 0 |
| 16s | 20 | 0 |
| 17s | 22 | 0 |
| 17s | 14 | 6 |
| 18s | 14 | 0 |
| 18s | 24 | 0 |
| 19s | 20 | 0 |
| 19s | 22 | 0 |
| 20s | 18 | 0 |
| 20s | 26 | 0 |
- Clients — Backoff + jitter — healthy — 18 new requests/s
- Service — handles up to 30 requests/s — healthy — receiving 22/s
Show data table
| Time | First attempts | Retries |
|---|---|---|
| 1s | 30 | 0 |
| 1s | 32 | 0 |
| 2s | 30 | 0 |
| 2s | 16 | 2 |
| 3s | 20 | 0 |
| 3s | 12 | 2 |
| 4s | 14 | 0 |
| 4s | 22 | 0 |
| 5s | 20 | 2 |
| 5s | 14 | 0 |
| 6s | 18 | 2 |
| 6s | 24 | 0 |
| 7s | 8 | 0 |
| 7s | 18 | 0 |
| 8s | 14 | 0 |
| 8s | 18 | 0 |
| 9s | 12 | 10 |
| 9s | 20 | 26 |
| 10s | 14 | 36 |
| 10s | 20 | 36 |
| 11s | 20 | 54 |
| 11s | 12 | 50 |
| 12s | 38 | 58 |
| 12s | 8 | 70 |
| 13s | 20 | 40 |
| 13s | 10 | 32 |
| 14s | 12 | 18 |
| 14s | 18 | 2 |
| 15s | 20 | 0 |
| 15s | 22 | 0 |
| 16s | 16 | 0 |
| 16s | 20 | 0 |
| 17s | 22 | 4 |
| 17s | 14 | 8 |
| 18s | 14 | 0 |
| 18s | 24 | 0 |
| 19s | 20 | 0 |
| 19s | 22 | 0 |
| 20s | 18 | 0 |
| 20s | 26 | 0 |
- Request
- Retry
- Response
- Error / rejected
| Measure | Side 1 · Exponential backoff | Side 2 · Backoff + jitter | Gap |
|---|---|---|---|
| New requests from users | 376 | 376 | Same requests |
| Attempts sent (first tries + retries) | 601 (1.60×) | 602 (1.60×) | Exponential backoff lower by 1 |
| Busiest moment, attempts per second | 84 | 96 | Exponential backoff lower by 12 |
| Rejected as overloaded (503) | 49 | 37 | Backoff + jitter lower by 12 |
| Requests that succeeded | 332 | 323 | Exponential backoff higher by 9 |
| p95 latency (slowest 5%) | 3.0 s | 2.2 s | Backoff + jitter lower by 754 ms |
| Recovery after the outage (95% succeed again) | 3.0 s | 2.0 s | Backoff + jitter lower by 1.0 s |
Changing a setting starts both sides again, so the numbers always describe one setup from its start. Jitter picks each wait at random, but from its own random numbers, so both sides still get the same new requests. A gap in one row can point the other way in another: read the whole table.
Incident drill: The service goes down while clients retry at once
Traffic is close to the limit: 26 new requests a second, and the service handles 30. Something will go wrong soon. Watch "Requests that succeeded" and "Load on the service". The drill takes about 2 minutes at the default speed; the speed control above the diagram makes it faster.
What this model simplifies
- A lost reply is drawn as an error coming back. In real systems nothing comes back, and the client waits until its timeout.
- Failures are instant 503s. Real failures are often timeouts, which also tie up client threads while they wait — making retries even more expensive.
- The service rejects anything above 30 requests/s in each quarter-second. Real services degrade gradually before they fall over.
- Only one layer retries. In real call chains each layer may retry, and the amplification multiplies across layers.
- Rejecting a request costs the service nothing here. On a real server each reject still uses CPU, which is why client-side throttling helps it recover.