policybook / retry

retry

Policies for deciding how long to wait before trying again. The delay curve is the part everyone already knows. The part that decides outcomes is where the randomness goes.

Choosing one

If you needUseBecause

A sensible default

full jitter

Same curve as exponential, spread across a fleet: 2.6% peak against 15.1%.

The backoff to actually back off

equal jitter

Guarantees a floor of half the ceiling. Full jitter can return zero every time.

To disperse a fleet as thoroughly as possible

decorrelated jitter

Whole schedules diverge, not just individual attempts: 1.1% peak, the lowest here.

A delay sequence reproducible without randomness

exponential

nextDelay(3) is 400 every time. It also synchronises every client.

To honour a server that told you when to return

Retry-After-aware

99.6% success against 19.9%, and the worst herd of any policy here.

The naive baseline, to measure against

constant

sleep(100) in a loop. Included to be measured, not recommended.

Benchmarks

Success rate on each trace, measured by this repository's benchmarks.

Policy outage-30s
Retry-After aware 0.9960
Exponential 0.4000
Equal jitter 0.3020
Decorrelated jitter 0.2580
Exponential with full jitter 0.1990
Constant 0.0180

Every policy