The Schedule
retry delays grow geometrically:
attempt 1 fails → wait 100ms → attempt 2
attempt 2 fails → wait 200ms → attempt 3
attempt 3 fails → wait 400ms → attempt 4
attempt 4 fails → wait 800ms → give up (cap reached)
delay = base × 2^(attempt-1), capped at max:
min(base * 2^n, max_delay)
base ~100ms typical; max ~10–60s depending on operation class.
Why Growth Is the Point
a struggling dependency needs TIME to recover —
recovery means draining queues, GC settling, autoscaling.
linear/eager retries hammer it during exactly that window:
fixed 100ms retries: 10 req/s sustained pressure ✗
exponential: pressure DECAYS as failure persists ✓
it's automatic load-shaping: the sicker the target,
the slower the requests arrive. recovery becomes possible.
second purpose: OUTLIER tolerance. transient blips resolve
in ms; deeper trouble resolves in seconds. the growing
schedule spans both without human tuning.
Jitter: The Non-Negotiable Companion
synchronized clients retry on the SAME schedule:
t=0: dependency hiccups. 1000 clients fail together.
t=100: all 1000 retry TOGETHER → spike → fail together
t=300: all 1000 again...
the THUNDERING HERD — your retry logic DDoSing its own target.
JITTER randomizes each client's delay:
delay = random(0, min(cap, base × 2^n))
(full jitter) or ±50% around computed value (equal/partial)
result: retry load spreads smoothly instead of pulsing.
AWS-style guidance: full jitter performs best empirically.
Parameters That Matter
| Parameter | Typical | Notes |
|---|---|---|
| base | 100–500ms | below p99 of normal latency |
| factor | 2 | rarely tuned elsewhere |
| max delay | 5–60s | bounded patience |
| max attempts | 3–6 | total envelope matters more |
| deadline | per-operation | attempts must FIT inside |
interactive paths: fewer attempts, tighter cap
(user is waiting!)
background/queues: more attempts, generous caps,
plus DLQ at the end of the road.
Interview Framing
“Batch job hammering an API gets throttled, retries make it worse” scored diagnosis: missing backoff+jitter, prescribe exponential-with-full-jitter with concrete numbers, fit-to-deadline arithmetic, note the decay-pressure property as WHY it works. Two words interviewers listen for: “geometric” and “jitter” — say both, explain the herd once, move on.
Premium Content
Unlock Exponential Backoff and all premium lessons with a subscription.
All premium lessons
Ad-free experience
Priority support
From ₹199.99/year — See plans