Articulation
Search

Backoff and Jitter Playground

Adjust an exponential backoff schedule and watch what happens when two dozen clients retry at once — with and without randomness.

Published 1 min read

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.

Jitter
24 clients, no jitter. Every client fails at time 0 and retries on the same schedule. Most retries within any 100 ms: 24.
24 clients, full jitter. Most retries within any 100 ms: 19.
One client's schedule with the current settings
RetryCeilingDelayFires at
1200 ms2 ms2 ms
2400 ms25 ms27 ms
3800 ms782 ms809 ms
41.6 s1.1 s1.9 s
53.2 s1.7 s3.6 s
66.4 s2.6 s6.2 s

The schedules

For retry number nn (counting from zero), with base delay bb, multiplier mm and cap cc, the exponential ceiling is

dn=min⁡(c,  b⋅m n).d_n = \min\left(c,\; b \cdot m^{\,n}\right).

The three modes then choose the actual delay as follows, where U(a,z)U(a, z) is a uniformly random value between aa and zz:

ModeDelay before retry nn
Nonednd_n
Equaldn/2+U(0, dn/2)d_n / 2 + U(0,\, d_n / 2)
FullU(0, dn)U(0,\, d_n)

Without jitter, every client computes the same dnd_n, 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.
  • Note Retries are inevitable

    Over a network, a client that times out cannot know what happened. So it will retry — and the system must be built to survive that.

    Related

  • Essay Idempotency, and Why Retries Need It

    A network can't tell a client whether its request failed or only its reply did. Idempotent operations make that ambiguity safe to retry through.

    Related

  • Atlas How to Read an Institutional Map

    A walk through the relationship explorer using a fictional republic — what the boxes and arrows mean, and what a diagram like this can and cannot tell you.

    Also about Visualisation