Backoff
Build a retry schedule and see every attempt's delay, with the jitter that stops your clients synchronising.
delay(n) = min(30000, 100 × 2^(n-1)) sleep = delay/2 + random(0, delay/2)
Half fixed, half random. Keeps a floor under every wait and still breaks the herd up.
Without jitter every client that failed together wakes up together: the retry wave lands on the recovering service in one burst and knocks it straight back over. Spreading the wake-ups usually buys more than tuning the factor. Spread bars share one axis, so you can watch the window slide and widen; elapsed takes the midpoint of each range, worst case sums the top of it, and retries end assumes attempt 1 fires now.
Exponential backoff without jitter produces a thundering herd: every client that failed at the same moment retries at the same moment, and the service that was struggling gets hit by a synchronised wave. Adding randomness spreads them out, and the different strategies — full, equal, decorrelated — spread them differently.
Set the base delay, the multiplier and the cap, and the whole schedule is laid out attempt by attempt with the total elapsed time. Seeing that a five-attempt schedule gives up after thirty seconds, or after eleven minutes, tends to settle arguments about timeouts quickly.
What people open it for
- Choosing retry settings for an HTTP client or a job queue
- Showing how long a caller waits before the last attempt fails
- Comparing full jitter against decorrelated jitter concretely
In the terminal
tools backoff
Every utility is also a command in the desktop's shell.