Timeouts, Retries and Circuit Breakers: How Retries Take a System Down
· Architecture · Microservices · Resilience · Performance
By Alain Cyr, Founder, Koesion

In the post about one slow service, payment history took 500 ms and the question was how to keep the screen fast. This post is about the Tuesday when it takes thirty seconds.
Nothing is broken that day. The payment-history database is running a heavy report and is slow. What happens next is done entirely by code that was written to make the system more reliable.
Retries multiply
The mobile app retries a failed request three times. So does the BFF. So does the Payments service when its query times out. Each of those choices was reasonable to the person who made it.
Each layer made a local decision. Nobody decided the total.
One tap now produces twenty-seven queries on a database whose only problem was too many queries. It stops being slow and becomes unreachable. And it stays unreachable after the report finishes, because the retries alone are enough load to keep it down.
A retry is a bet that the failure was a passing accident, such as a dropped packet or a node that restarted. When the failure is caused by overload, the bet is wrong every time, and every retry makes it more wrong.
The missing timeout
Meanwhile something else is going on in the BFF.
Its HTTP client has no timeout, or the library default of something like thirty seconds, which comes to the same thing. Every request for payment history takes a worker thread and holds it. The pool has twenty. Within a few seconds all twenty are waiting on the same slow service.
The claim screen does not need payment history. It fails anyway.
Now the policy screen fails too, and so does the health check. The load balancer sees a dead BFF and restarts it. One slow dependency has taken out the part of the system that was working.
So the first rule is the plainest of all: every network call has a timeout, and you chose its value. Take the callee’s 99th percentile latency and add some margin. If payment history normally answers in 500 ms, a two-second timeout is generous and a thirty-second one is a bug. Better still, give each dependency its own small pool of connections, so that a slow one can only use up its own share. That is a bulkhead.
Retry rules
Retries are still worth having, for the failures they were meant for. They need limits.
Retry in one place. Choose one layer, usually the one closest to the failing call, and let the others pass errors through. Three layers of three is twenty-seven. One layer of three is three.
Retry only what is safe and likely to work. A timeout or a 503 on an idempotent operation, yes. A 400 or a 409 will fail the same way next time. And a non-idempotent call must not be retried at all, which is why idempotency comes first.
Back off, with jitter. Waiting 1 s, then 2 s, then 4 s gives the service room to recover. But if a thousand clients failed at the same moment, they all come back at the same moment too, three times over.
The same number of retries in both. The top one is a stampede.
Add a random part to every delay. It is one line of code.
Set a budget. Allow retries to be at most, say, ten percent of normal traffic. Above that, stop retrying and fail. A budget is what keeps a bad minute from feeding itself.
The circuit breaker
Timeouts and budgets limit the damage of each call. A circuit breaker goes one step further and stops calling.
Open means the caller has stopped asking. The dependency gets room to recover.
When failures pass a threshold, the breaker opens. For the next thirty seconds, calls fail at once without touching the network. Then one request is let through as a probe. If it succeeds, the breaker closes again.
This helps in both directions. The struggling service stops being hit, and the caller gets its threads back straight away instead of after a timeout.
A breaker is only useful if you have decided what to do while it is open. The BFF posts already answered that for payment history: the screen renders with that block marked unavailable. If you have no fallback, the breaker just gives you the same error sooner. That is still an improvement, but a smaller one.
The order to do it in
- Put a timeout on every outbound call. This alone would have saved the BFF;
- Retry in one layer only, with jitter and a budget;
- Add breakers on the dependencies that have a fallback;
- On the server side, shed load early: when you are over capacity, answer 503 at once instead of queueing work you will finish too late to matter.
Your HTTP library or your service mesh has all four built in. Use them, but pick the numbers yourself. The defaults were chosen by someone who has never seen your traffic.
A retry is new load on a system that has just told you it is struggling. Budget it like load.
Where to go next
- Backend for Frontend: Should One Slow Service Hold Back the Entire UI? — the latency budget and the fallback that a breaker relies on;
- Idempotency: Surviving At-Least-Once Delivery — what makes a retry safe in the first place.
References
- Marc Brooker, Timeouts, retries, and backoff with jitter — the clearest short text on the subject, from the Amazon Builders’ Library;
- Mike Ulrich, Addressing Cascading Failures — the Google SRE book chapter, including retry budgets;
- Martin Fowler, CircuitBreaker — the pattern in two pages;
- Michael Nygard, Release It! — where circuit breakers and bulkheads got their names.