Why circuit breaker?

A flaky downstream service and a shared connection pool. Watch what happens when every caller waits out the timeout versus when a breaker fails fast.

1
Part 1 · Watch the concept

The idea in 27 seconds

A fixed animation — no controls, nothing to configure. It shows the shape of the problem and the shape of the fix, with the story written out underneath.

Loading player…

~27s animated walkthrough: a hung downstream call exhausting a connection pool vs. a breaker failing fast.

The story the animation tells

Service A calls Service B, and for the first few seconds it's unremarkable: request out, response back, request out, response back. This is the shape of almost every dependency you own.

Then Service B gets slow. Not down — slow, which is worse, because a down service answers instantly and a slow one answers never. Service A's calls stop returning, so it does the thing everyone's HTTP client does by default: it retries. Watch the pending counter climb — 1, then 4, then 9, then 16 — each retry holding a connection open and waiting on a service that is not going to answer. Service A isn't broken; it's just completely full of requests that are going nowhere.

Now the bill comes due upstream. Service A's pool is exhausted, so it can no longer serve anyone — including the callers asking for things that have nothing to do with Service B. The client goes red. One slow dependency has taken down a service that was perfectly healthy, and from the client's point of view your whole system is down.

So a breaker goes in between them. While things are fine, it does nothing but count. Three consecutive failures and it flips open — and now the calls fail in microseconds instead of hanging for thirty seconds, so the pool never fills and Service A keeps serving everything else. After a cooldown it lets exactly one trial request through to check whether B has recovered. It has, so the breaker closes and normal traffic resumes.

The point. A circuit breaker doesn't make the failing call succeed — it makes failing cheap. The resource you're protecting isn't the downstream service, it's your own thread and connection pool, which is what actually decides whether one dependency's bad day becomes everybody's outage.

2
Part 2 · Run the numbers

Interactive traffic simulator

Now drive it yourself. Set the downstream failure rate, pool size, trip threshold, and cooldown, then watch real counters — pool slots, fast-fails, pool rejections, breaker state transitions — respond to your settings.

Service A → Service B
Every request goes straight to the downstream service and holds a slot for the full duration, success or failure.
sent
0
succeeded
0
pool rejected
0
avg latency
—
Closed
Open
Half-Open
(breaker disabled — every call goes straight through)
Connection pool0 / 10 slots held
succeeding waiting on a timeout half-open trial free
pool utilization
0%
timed-out waits
0
fast-failed
0
Last events
Run traffic to see breaker decisions.
Why this matters
  • Failures are expensive precisely because they're slow. A failing call still holds a pool slot for the full timeout — often longer than a successful call.
  • A full pool fails everyone, not just the doomed calls. Turn the breaker off and crank the failure rate — watch "pool rejected" climb even though some requests would have succeeded.
  • Failing fast is a feature. With the breaker on, a fast-failed request costs ~0ms instead of the full timeout, and the half-open probe checks recovery without risking the whole pool.
Downstream console
Make Service B flaky and watch the pool.
Try this
Set failure rate to 70%+ and run traffic. The pool fills with red (timed-out) slots and stays full — watch “pool rejected” start climbing. Then flip the breaker on and rerun with the same settings.