All glossary terms

Serving

Circuit breaker

A trip switch between your code and a misbehaving provider: past a failure threshold, calls fail fast and take a fallback rung instead of a dead wait each.

A hung dependency does not fail loudly; it fails slowly, by timing out, and every caller absorbs the full timeout before it learns anything. A circuit breaker watches the recent failure share, and past a threshold stops sending traffic at all - calls fail fast against the breaker instead of waiting on the dependency - while the breaker periodically sends a probe to detect recovery. The point is not fewer failures; the point is cheap failures and a bounded blast radius.

In AI serving the dependency being protected is a provider that can degrade without notice, so the breaker is paired with a fallback ladder: retries with backoff first, then a smaller or older model, then a cached reply - ordered so users meet slow before they meet gone. The breaker decides when to leave the primary rung, and the ladder decides where to land. Without the ladder, a breaker is just a faster error message.

The reporting matters as much as the trip. A breaker that fails 90 of 100 calls over to a cached reply has kept the feature up, and the report that says so honestly - which share rode which rung - is what makes the design sustainable, because a ladder quietly absorbing most traffic is a quality regression wearing an uptime number.

A worked example

A provider hangs, then recovers after a while. Each call against it would otherwise wait out a 30-second timeout. With a breaker, 10 calls trip it and the next 90 fail fast to a cached reply answered in 50 ms.

  1. No breaker: 100 calls x 30 s = 3,000 s of cumulative user-visible wait, and every answer is an error after the wait.
  2. With the breaker: 10 calls x 30 s = 300 s of wait before the trip, then 90 calls x 0.05 s = 4.5 s - a 3,300-fold drop in total wait across the same incident.
  3. The trade named plainly: 90 of 100 answers came from a cache instead of the model, and the availability report should say so.

3,000 s of cumulative wait becomes about 300 s plus 4.5 s, with 90 answers served from the fallback rung - the breaker converts dead waits into cheap, honest answers.

Where this shows up

Related terms