Skip to content
System Designer

Stay up · 3 minutes

Timeouts and failing fast

When a dependency is slow, give up early so your servers do not pile up waiting.

Open this lesson
When a dependency is slow, give up early so your servers do not pile up waiting.

A slow friend is worse than a dead one

A dead service fails fast. A slow one holds your servers waiting until they have no room for anything else. Set a timeout so you stop waiting after a short time, and add a circuit breaker that stops calling a failing service for a while and answers from a fallback.

Open, closed, half open

Closed calls go through. Repeated failures open the breaker; one probe after a cooldown tests whether it can close again.

Try the idea

The map service has become slow and is dragging everything down. Add a timeout and a circuit breaker.

Key numbers

Default wait on many systems
≈ 30 s. far too long, approx.
A good timeout
≈ 3x normal p99. for example 300 ms if p99 is 100 ms
Breaker stays open
≈ 30 s. approx.

Check your reasoning

Think through these questions before opening the lesson. In the game you can test the idea and compare your reasoning.

  • Why is a slow service worse than a dead one?
  • What does an open breaker do?
  • A timeout of 30 seconds on a 100 ms service is:

The key point

Wait briefly, stop calling what is failing, and have a fallback.

Practise this idea

Continue through the lesson tracks