Dashboard
Courses
Problems
Badges
Theme
Sign inStart free
Courses/Reliability and Failure
Lesson 6 of 24

Retries, backoff and retry storms

Retry transient failures without multiplying load and turning a blip into an outage.

15 min read

When a retry helps

Many failures are transient: a dropped packet, a failover in progress, an instance that just restarted. Retrying such a request usually succeeds and the user never notices. But retries are only safe for idempotent operations, and only useful for transient errors. Retrying a 400 Bad Request or a validation error just repeats the failure, so retry on timeouts, connection errors, 503 and 429, not on client errors.

Exponential backoff with jitter

Retrying immediately hammers a dependency at the exact moment it is struggling. Exponential backoff waits longer after each failure: 100 ms, 200 ms, 400 ms, 800 ms, capped at a few seconds. Jitter randomises each wait so that thousands of clients that failed at the same instant do not retry at the same instant. Full jitter, sleep = random(0, min(cap, base x 2^attempt)), spreads retries evenly and is a good default.

Retry storms and amplification

Retries multiply across layers. If the edge, the API and the service client each make 1 attempt plus 3 retries, one user request can become 4 x 4 x 4 = 64 calls to the database when it is already failing. A dependency at 100% capacity that starts failing then receives several times its normal load and can never recover, even after the original cause is gone. This is a metastable failure: the retries themselves sustain the outage.

Keeping retries bounded

Limit retries so they cannot become the load. The goal is that retries rescue the occasional unlucky request but disappear as a share of load when the dependency is genuinely down.

  • Retry at one layer only, usually the one closest to the failing call
  • Use a retry budget: retries may add at most about 10% to normal request volume
  • Cap attempts at 2 or 3 and respect the overall deadline
  • Honour Retry-After headers and 429 responses from the server

Key takeaways

  • Retry only idempotent operations, and only on transient errors
  • Use exponential backoff with full jitter to spread retries out
  • Retries multiply across layers; retry at one layer only
  • A retry budget stops retries from turning a blip into a metastable outage

Sign in to track lessons and earn badges.

Timeouts and deadlinesCircuit breakers

Coming up

Course: 0/24 lessons · 0/10 challenges0%

Build it on the canvas, pass the review (70+) and mark it complete to count it toward the course badge.

  1. 1/10Design a Web CrawlerUse per-host timeouts, bounded retries and bulkheads so one slow or hostile site never stalls the whole crawl.Medium
  2. 2/10Design a Weather API ProxyCache provider responses and serve stale data behind a circuit breaker when the paid upstream API is down.
Easy
All 10 challenges →