Rejecting

Timeouts and retries: how slow dependencies cause outages

A timeout is how long a caller is willing to wait. Without one, a slow dependency holds threads, memory and connections indefinitely; with a badly chosen one, healthy-but-busy calls fail for no reason.

What causes it

Slowness spreads upstream. When a database slows down, every service calling it holds resources longer, which slows those services in turn. Timeouts cut that chain. Retries can then recover transient failures — but retrying an overloaded service multiplies its load, so retries need exponential back-off, jitter and a small cap.

How to recognise it

The math

Retry back-off = base × 2^attempt × random(0.5, 1.5)

Error messages you will see

ErrorSeen in
504 Gateway TimeoutUsers, Router, Server, Database, Cache, Queue and 214 more
Task timed outAWS Lambda

How to fix it

Reproduce it in the simulator

Open the simulator, build a small architecture and use Fault injection in the inspector, or push traffic past a component’s capacity.

Open the simulator

Learn more

Part of the guide Load balancing and capacity planning.

Related failure modes