Skip to content

"Retries make systems more reliable"

“Add retries. Networks are unreliable, and most failures are transient, so retrying makes the system more reliable.”

It’s one of the first resilience patterns engineers learn, and every HTTP client and service mesh offers it as a setting.

A database tier can serve 800 requests per second. One afternoon, demand reaches 900 requests per second. Every request beyond capacity is rejected quickly. Each layer that calls the database retries a failed call up to 3 more times (4 attempts in total), immediately.

Assumption Value
Demand from users 900 requests per second
Database capacity 800 requests per second; excess is rejected
Retries Up to 3 retries per call, no backoff, no budget
Failures Caused only by overload; every attempt beyond capacity fails

Without retries: 800 requests succeed and 100 fail. Success rate 88.9%. The database sees 900 attempts.

With retries at one layer: a failed attempt is retried, which adds load, which causes more failures, which causes more retries. Solving for the steady state, where the failure rate produces exactly the load that sustains it:

Aspect No retries Retries at one layer Retries at three layers
Attempts reaching the database 900 per second about 1,890 per second about 23,700 per second
Share of attempts that fail 11% 58% 97%
Requests that succeed 800 per second 800 per second 800 per second, at best

Retries produced no additional successes. The database still completed 800 requests a second, because that’s its capacity. What changed is that it now receives 2.1 times the load at one layer, and 26 times at three layers, because 4 attempts at each of three layers can become up to 64 attempts for one user request.

And that’s the optimistic version. Here, rejected attempts cost nothing. In real systems they consume connections, threads and CPU, so useful throughput falls below 800, timeouts lengthen, and the tier that was 11% short of capacity collapses.

Retries stacked across three layers1. Demand exceeds capacity by 100 requests a second, about 11%. 2. Retries at three layers push about 23,700 attempts a second at a tier that can serve 800. 3. Successful requests don't increase. Only the load does. Users900 requests/s Web tierup to 4 attempts API tierup to 4 attempts Still 800/s succeedwith or without retries Databasecapacity 800/s Data serviceup to 4 attempts123
Retries stacked across three layers Each layer retries independently, so one user request can become up to 64 attempts at the bottom, exactly when the bottom has no spare capacity.
  1. Demand exceeds capacity by 100 requests a second, about 11%.
  2. Retries at three layers push about 23,700 attempts a second at a tier that can serve 800.
  3. Successful requests don't increase. Only the load does.

Change the demand, the number of retries and how many layers retry. Watch the attempts reaching the database against the requests that actually succeed. The chart shows attempts at every level of demand: flat below capacity, then a cliff. The first scenario reproduces the example above.

Retries help when failures are independent of load: a dropped packet, a single unhealthy instance, a brief leader election. Trying again draws a fresh, probably successful outcome.

Under overload, failures are caused by load. A retry isn’t a fresh draw; it’s another unit of the very thing that caused the failure. The system enters a feedback loop: more failures, more retries, more load, more failures. And because each layer retries independently, the multipliers stack: the attempts reaching the bottom grow with the product of the retry counts at every layer.

  • Failures are transient and independent of load: network blips, a crashed instance behind a load balancer, a failover in progress.
  • The operation is idempotent, so a repeated attempt is safe.
  • Retries are few, delayed and jittered, so they don’t arrive in synchronized waves.
  • Only one layer retries, usually the one closest to the user or the one with the most context.
  • There’s spare capacity to absorb the retried attempts.

Retry transient failures at one layer, with exponential backoff, jitter and a retry budget, and only for idempotent operations. Under overload, shed load instead of retrying.

A retry budget caps retries as a share of normal traffic. With a 10% budget, the database in this example would see at most 990 attempts a second instead of 23,700. Success stays at 800 a second either way, but the system stays healthy enough to recover the moment demand drops. Pair it with circuit breakers, which stop calling a dependency that’s failing, and load shedding, which rejects work early and cheaply at the edge.

Discussion question. Your team’s service mesh retries every failed call twice by default, and so does your HTTP client library. Nobody chose this. Who should decide where retries happen, and how would you find every place they’re configured today?

Exercise. Using the same assumptions, add a retry budget of 10% at the API tier only, and remove retries from the web and data tiers. How many attempts reach the database, and what share fail?

Worked answer

Retries are capped at 10% of the 900 requests a second, so at most 90 retries a second are added: 990 attempts reach the database. Capacity is 800, so 190 a second fail, about 19% of attempts. Users see 800 successes a second, the same as with no retries at all, and the database carries 10% extra load instead of 26 times. When demand drops back below 800, the system recovers immediately, because there’s no backlog of retries to drain.

Glossary: circuit breaker, idempotency

Written and edited by Abhinav Taduka, enterprise software architect.