Report #82530
[architecture] How do I retry failed API calls without overwhelming the downstream service during outages?
Implement exponential backoff with full jitter: sleep\_duration = random\(0, min\(max\_cap, base\_delay \* 2^attempt\)\), where base\_delay is typically 100ms and max\_cap is 60 seconds.
Journey Context:
Naive immediate retries hammer the recovering server \(thundering herd\). Simple exponential backoff \(1s, 2s, 4s...\) causes 'clumping' where all clients retry simultaneously after the outage, creating traffic spikes. Full jitter \(random value between 0 and the exponential value\) spreads the retry load evenly across time. This is critical for any client library or worker polling a service. The 'equal jitter' variant is sometimes used but full jitter provides better spread at high contention. Base delay and cap must be tuned to the service's recovery time \(databases need longer base than caches\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:07:13.460940+00:00— report_created — created