Try
↑ ↓ move↵ openesc close

Retries and circuit breakers lab

Degrade a dependency at a chosen moment and watch six client policies react. Compare how many attempts each sends, how much load the dependency sees and whether it ever recovers.

tick 30healthy, incident not startedcapacity 10 per tick, 4 during the incident

The incident length and severity come from the sliders.
Attempts reaching the dependency, per tick
Attempts reaching the dependency, per tick. Text version available below the chart.05101520tick 1tick 16tick 30timeattempts per tick
Attempts that succeeded, last 20 ticks
Attempts that succeeded, last 20 ticks. Text version available below the chart.0%25%50%75%100%tick 1tick 16tick 30timesuccess rate
Attempts per new request, last 20 ticks
Attempts per new request, last 20 ticks. Text version available below the chart.0.00.51.01.52.0tick 1tick 16tick 30timeattempts per request

No retry

attempts per request
1.00x
attempts succeeding
100%
waiting at dependency
5

Immediate retries

attempts per request
1.00x
attempts succeeding
100%
waiting at dependency
5

Exponential backoff

attempts per request
1.00x
attempts succeeding
100%
waiting at dependency
5

Backoff with full jitter

attempts per request
1.00x
attempts succeeding
100%
waiting at dependency
5

Jitter and a retry budget

attempts per request
1.00x
attempts succeeding
100%
waiting at dependency
5

Retry budget: 10.0 tokens left.

Jitter and a circuit breaker

attempts per request
1.00x
attempts succeeding
100%
waiting at dependency
5

Breaker is closed. It has opened 0 times.

Circuit breaker, live

closedopenhalf-openhalf of recent attempts failafter 20 ticks3 probes passa probe fails
Breaker state over time

Outcomes by policy

Requests are counted by when they began. Peak load is the busiest 4 ticks in attempts per tick, and peak retry load counts only retries.
PolicyAttempts per requestBegan during incident, succeededBegan after, succeededPeak loadPeak retry loadWasted workRecovered after
No retry1.00x100%100%8.50.00not yet
Immediate retries1.00x100%100%8.50.00not yet
Exponential backoff1.00x100%100%8.50.00not yet
Backoff with full jitter1.00x100%100%8.50.00not yet
Jitter and a retry budget1.00x100%100%8.50.00not yet
Jitter and a circuit breaker1.00x100%100%8.50.00not yet

What to try

Each one sets up a starting point. Then make the change it describes.

  1. A short incident becomes a long one

    Keep the defaults and compare all six. Watch the dependency load chart and the success chart for Immediate retries.

    Look for. With no retries the dependency recovers soon after the incident ends. With immediate retries the dependency stays buried long after it is healthy, because the retries keep its queue full and every answer comes too late.

  2. Jitter is not a cure

    Compare Immediate retries, Exponential backoff and Backoff with full jitter in the table. Look at attempts per request and whether each recovers.

    Look for. Backoff and jitter spread retries out and lower the peak load. They do not lower the total, so the dependency can still stay overloaded. Limiting the number of retries is what ends the storm.

  3. A budget and a breaker

    Pick Jitter and a retry budget, then Jitter and a circuit breaker, one at a time.

    Look for. The budget caps retries at a tenth of the new requests, so the dependency sees little extra load. The breaker opens during the incident, sends nothing while open, then probes and closes. Both recover. The breaker does it fastest, and it fails more requests while it is open.

  4. Clients that wake at once

    Set clients waking at once to 80, lower the new requests to 0.3, and compare Immediate retries, Exponential backoff and Backoff with full jitter. Read the peak retry load column.

    Look for. All the woken clients fail together, so plain backoff makes them retry together, wave after wave. Full jitter gives each client its own delay and flattens the peaks.

  5. A lighter load

    Drop the new requests to 0.3 so the degraded dependency can still keep up, and compare all six.

    Look for. Nothing fails, so no policy has anything to do. Retries and breakers only change the outcome when the dependency is overloaded.

New to the idea? Read the lesson first. Every number here comes from a seeded simulator, so the same seed gives the same run.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms