Reliabilityfail-fastfast failure

Fail fast

Definition

Fail fast is the practice of detecting that a request is doomed (a dependency is down, a deadline has passed, a pool is full) and rejecting it at once rather than letting it wait.

In practice

A slow failure is worse than a quick one: a request stuck for 30 seconds holds a worker, a connection and memory the whole time, and the user still gets an error. Timeouts, open circuit breakers and bounded queues all turn slow failures into fast ones, which keeps the caller healthy and frees capacity for requests that can succeed.

Failing fast only helps if the caller does something sensible with the error: a fallback, a clear message or a bounded retry later. Rejecting too eagerly, for example with a breaker that opens on a single blip, turns minor noise into visible errors. Fast rejection should also be cheap, so it does not become the new bottleneck.

Example

With the payments breaker open, POST /checkout returns 503 in 2 ms with a "try again shortly" message instead of waiting for a 10-second connect timeout on every request.