Reliability engineering: timeouts, retries, circuit breakers, SLOs, incidents

Reading: 40 min, plus 8 in closed details. How a service keeps working when what it depends on does not: failure modes, timeouts and deadlines, retries with backoff, jitter and budgets, circuit breakers, bulkheads and shedding, rate-limit algorithms, health checks, safe deploys, SLOs and error budgets, incidents, LLM calls, chaos testing. Includes a retry storm measured on a real local service. Child page of Topic: swe-and-system-design. Data as of October 2026.

The idea in one screen

A service survives dependencies that are slow, overloaded or down when it bounds every wait (timeouts, deadlines), caps the extra work failures create (one retry layer with a budget) and refuses or cheapens work it cannot finish (shedding, breakers, fallbacks); an SLO then says how much failure is allowed, and the rest is spent on shipping.

Running example, from the parent topic: a phone app sends a message to our chat API, which saves it and calls a model provider (another company's service). At the parent root's 10 million messages a day, "rarely" means "every few minutes". Fig. 1 runs one provider slowdown through the page's simulation engine (the one the Resilience lab uses), without and with the defences; the layout is a schematic.

  1. Normal traffic. 100 requests a second reach our chat API's 20 workers: half send a message and call the provider (25 ms), half load history (5 ms of our own work). At most 6 workers wait on the provider at any moment.
  2. The provider slows to 3 s per call. Nothing errors. Each message request now holds its worker 120 times longer (3 s against 25 ms), and within the second all 20 of 20 workers are waiting on the provider.
  3. The cascade. New requests queue behind the stuck workers (458 waiting at the worst moment) and users give up after 2 s. History loads, which never touch the provider, fail with the rest: 403 requests failed, 175 of them history loads.
  4. Bound every wait. A 100 ms timeout on the provider call frees each worker after 100 ms instead of 3 s, and a deadline passed down every hop stops work nobody is waiting for (section 3).
  5. Cap the extra work. A retry turns one failure into more calls, at every layer that retries. In the measured storm of section 5, retrying at once sent 2.5 attempts per request and never recovered; a retry budget held it to 1.0.
  6. Refuse or cheapen what cannot be finished. After 20 calls with at least half failing, a circuit breaker opens and message requests get a smaller fallback model at once; a queue bounded at 40 sheds the rest. Same slowdown: 0 requests failed, 336 answered by the fallback.
  7. Where each defence acts. At the edge and load balancer: a rate limit per client (429), health checks that choose servers, a canary that gives a new build 5%. In our chat API: a bounded queue that sheds early (503), bulkheads (separate pools), a 10 s deadline per request. On the provider call: timeout = the deadline left, retries here only and budgeted, a breaker, then the fallback model. SLIs are counted at the phone app, as near the user as we can.

The rule under every section: each defence adds load or removes work. Retries add load; shedding, breakers and deadlines remove it. A system in trouble recovers only when the work removed beats the work added, which is why the measured retry storm never recovered with backoff and jitter alone and recovered at once with a retry budget or a bounded queue. And slow is worse than down: a dependency that is down fails fast, one that is slow quietly holds your workers until you fall over too.

You need: nothing beyond HTTP status codes. The parent Topic: swe-and-system-design (its Step 4) is the five-minute version of this page. Elsewhere: measuring (metrics, traces, alert rules) is Observability's; how many servers is Capacity planning and performance's; end-to-end idempotency is Distributed systems fundamentals section 9; rate limits as an API surface (headers, quotas) are Service APIs'; an LLM gateway's retries, cooldowns and fallbacks are Gateways and routing'.

SLI, SLO, error budget
the measure (good events / all events), the target for it, and 100% minus the target: the failures you may spend
Timeout, deadline
the longest one call waits; the absolute time after which the whole request is worthless
Retry budget
retries capped at a share of normal traffic, so they switch themselves off when most calls fail
Circuit breaker
stops calling a failing dependency for a while and fails fast instead
Bulkhead, load shedding
separate pools so one dependency cannot take every worker; rejecting excess work early and cheaply
Metastable failure
a bad state that persists after its trigger is gone, kept alive by a sustaining effect (usually retries)
Blast radius
how much of the product one failure or one change can hurt; canaries, waves, cells and bulkheads shrink it

1. What "reliable" means, and what each nine costs

Three promises that break separately: availability (it answers; for a service spread over many machines Google measures it by requests, "availability in terms of the request success rate", SRE book, ch. 3), durability (saved data stays saved: Amazon S3 is "designed to provide 99.999999999% (11 nines) data durability" but "99.99% availability", S3 FAQ) and correctness (the answer is right: a model can return 200 OK with a worse answer, as in Anthropic's 2025 account of three serving bugs that no error counter saw, in the root's Case files; LLM quality is measured with evaluations, Production eval engineering).

100% is impossible, and each row is ten times less downtime while the cost grows faster: "an incremental improvement in reliability may cost 100x more than the previous increment" (SRE book, ch. 3). Its worked example: moving a service with $1M of revenue from 99.9% to 99.99% is worth at most $900 ($1M × 0.09%). Past a point users cannot tell, because their phone network fails more often.

Treynor and colleagues: "A service cannot be more available than the intersection of all its critical dependencies", so critical dependencies "must offer one additional 9 relative to your service", the "rule of the extra 9" (ACM Queue 2017, archived). The ways out are to need fewer things (an optional dependency with a fallback) or to have copies (two providers, three replicas). Their second rule: availability is bounded by incident frequency times detection and recovery time. Three 20-minute outages a year are 60 minutes, already more than the 52.56 minutes that 99.99% allows: past three nines, reliability is mostly how fast you notice and undo a problem.

What the big LLM services showed (dated reading, 2026-10-04)

90-day uptime on their own status pages: OpenAI APIs 99.96%, ChatGPT 99.65% (status.openai.com); Claude API 99.52%, claude.ai 99.44% (status.claude.com). Each company's own aggregate definition, not comparable SLOs, but LLM products live around two to three nines.

Each nine is ten times less downtime

Allowed downtime = (1 − target) × period; the SRE book's availability table gives the same values with a 30-day month.

Required dependencies multiply: the chain is weaker than its weakest link

The parent's example figures; product 99.24%. The parent's Numbers to know tab has a calculator for chains like this.

2. How things fail

Crash (fail-stop)

The process dies; connections are refused at once. Easy to detect and route around.

Slow

It answers in 3 s instead of 30 ms. Nothing errors, so nothing alarms, while every caller holds a worker, a connection and memory 100 times longer. Most cascades start here.

Partial

One shard, zone or kind of request fails. Averages hide it: 1% of users completely broken looks like a 99% healthy service.

Gray failure

Health checks say "fine" while users see failures: "differential observability" (Huang et al., HotOS 2017). Defence: measure from the user's side (SLIs).

Metastable failure: broken after the cause is gone

Bronson and colleagues: "Metastable failures occur in open systems with an uncontrolled source of load where a trigger causes the system to enter a bad state that persists even when the trigger is removed" (HotOS 2021). An open system keeps receiving new work whatever it does (users keep sending messages). A system runs stable, then vulnerable (above a hidden load threshold, still healthy and efficient), until a trigger tips it over and a sustaining effect keeps it there.

"One of the most common failure-sustaining mechanisms is request retries" (same paper). A study of 22 metastable failures at 11 organisations found retry policy "by far, the most common sustaining effect ... affecting more than 50% of the studied incidents", and at least 4 of 15 major AWS outages in a decade were metastable (Huang et al., OSDI 2022). Bronson's lesson for postmortems: outages are "initially blamed on the trigger, but the true root cause is the sustaining effect." The root's Case files hold real ones: AWS's October 2025 EC2 outage (a queue that never drained), Google Cloud's June 2025 restart stampede, Roblox's 73-hour outage.

The loop that kept the measured service down after a 5-second trigger

Numbers from the measured run (4 slots of 25 ms, so 160 calls a second). The two green lines are the cuts that ended it there.

3. Timeouts and deadlines: never wait forever

A timeout is the longest a caller waits before giving up and freeing what it holds (a worker, a connection, memory). Without one, a single hung dependency can hold every worker in our chat API, and requests that never needed it (loading the conversation list) fail too. Many libraries do not set one: Python requests does "not time out unless a timeout value is set explicitly" (docs); "By default, gRPC does not set a deadline" (gRPC deadlines guide).

Choosing the number. Too long and workers pile up behind a slow dependency; too short and you abandon calls about to succeed (and retrying them doubles the load). Marc Brooker's method at AWS: "we choose an acceptable rate of false timeouts (such as 0.1%). Then, we look at the corresponding latency percentile on the downstream service (p99.9 in this example)" (Builders' Library, archived). A percentile such as p99.9 is the latency 99.9% of calls beat. When p99.9 sits close to p50, "adding some padding helps us avoid small latency increases that cause high numbers of timeouts."

Measured: the tail, not the 25 ms of work, sets the timeout

The tiny service of the experiment below (4 worker slots, 25 ms per call, 100 requests a second at random) answered 2,972 requests in 30 s: p50 27.5 ms, p90 42.5 ms, p99 62.3 ms, p99.9 72.3 ms, max 77.6 ms (Apple M1 Pro, 2026-10-04, src/lab/; histogram by src/gen_lat_js.py). Brooker's rule gives about 72 ms; padded to 100 ms. Queueing makes the tail.

Deadlines: pass the time left down the chain

A deadline is absolute ("worthless after 12:00:03.200"). Passing it down every hop is deadline propagation: "The tree of RPCs emanating from an initial request will all have the same absolute deadline" (SRE book, ch. 22).

  1. One deadline for the whole request. The phone app sets it once, now + 10 s, and it travels with the request to every hop (times illustrative).
  2. Each hop spends some of it. Our chat API spends 7 s on history and retrieval; what is left shrinks from 10 s to 3 s while the request moves.
  3. The next call gets only the time that remains. A 10 s request budget with 7 s already spent leaves the provider call 3 s, not a fresh 10, which would hold a worker for 7 s after the user stopped caring. gRPC converts "the deadline to a timeout from which the already elapsed time is already deducted", automatically in some languages and opt-in in others such as C++. Over HTTP there is no standard header (our experiment's service reads X-Deadline).
  4. Past the deadline, skip the work. A server that sees an expired deadline skips the work, because nobody is waiting (Yanacek, Using load shedding to avoid overload). In the measured storm of section 5 this raised the share of useful server work from 15.9% to 22.4% (mean of 3 seeds), but did not end the storm.

Mistakes that matter: one timeout for the whole stack, so an inner call outlives the caller who already gave up; an outer timeout shorter than inner timeout plus retries (Envoy counts retries inside the route timeout "to avoid an exponential retry/timeout explosion", Envoy router docs); a total timeout on a streamed LLM reply (section 14).

Library defaults and code (httpx, the requests and gRPC advice)

httpx is the exception among Python clients: it raises after "5 seconds of network inactivity" by default and splits the timeout into connect, read, write and pool parts (httpx docs). The requests docs: "Nearly all production code should use this parameter in nearly all requests". gRPC without a deadline means "a client to end up waiting for a response effectively forever".

# Python, httpx 0.28: separate connect and read limits, and a per-call budget client = httpx.Client(timeout=httpx.Timeout(2.0, connect=0.5)) # 2 s read/write/pool, 0.5 s to connect remaining = deadline - time.monotonic() r = client.post(url, json=body, timeout=max(0.05, remaining)) # never more than the time left

4. Retries: when they help, and how they hurt

A retry turns a momentary failure (a reset, a restarting server, a 503 from an instance being replaced) into a success. Retry only when all three hold: the error is transient (connection errors, timeouts, 503, 429 after its Retry-After; not 400, 422, 401 or 403); the operation is safe to repeat (reads are; "charge $20" needs an idempotency key; gRPC retries only before reply headers: "Once the response header is received, the RPC is committed", gRPC retry guide); and the dependency is healthy overall: "We avoid this amplification by retrying only when we observe that the dependency is healthy" (Brooker).

  1. One layer retries. The phone app tries 3 times: one tap, up to 3 requests to our API.
  2. Two layers. Our API also tries each of those 3 times: up to 9 provider calls.
  3. Three layers. The provider's gateway tries each 3 times: in our product, 3 tries each at the app, the API and the provider's gateway turn one tap into up to 27 model calls. The SRE book: attempts can reach "the product of the number of attempts at each layer" (ch. 22). Brooker's five-deep stack with three tries per layer: "the load on the database will increase 243x" (35 = 243).
  4. Retry at one layer. Hence "retry at a single point in the stack", usually the layer that knows the operation is idempotent; the others fail fast. One tap is then at most 3 model calls, and a retry budget (below) caps even those once most calls fail.

Backoff and jitter

Exponential backoff waits longer before each retry; jitter randomises each wait, because clients that failed together and back off by the same amounts come back together, in waves. Predict before you toggle: does jitter reduce the number of retries?

Brooker's 2015 simulation (AWS Architecture Blog), with attempt counting from 0: no jitter, min(cap, base * 2 ** attempt), is "the clear loser. It not only takes more work, but also takes more time"; full jitter, random_between(0, min(cap, base * 2 ** attempt)), "uses less work, but slightly more time" and is the usual default; "Of the jittered approaches, 'Equal Jitter' is the loser" (half fixed, half random); decorrelated jitter, min(cap, random_between(base, sleep * 3)), is close to full. With 100 contending clients jitter "reduced our call count by more than half"; the 2023 update says the scheme "continues to serve as a pillar for how Amazon builds remote client libraries".

The same 20 clients, failing at the same moment, retrying 4 times (base 100 ms)

Retries per 25 ms. Illustrative, seeded; checked by src/recompute.py. Jitter flattens the waves; the count stays 80. Brooker: "none of these approaches fundamentally change the N2 nature of the work". That is why the storm below did not end with jitter alone.

Retry budgets: capping the total

A retry budget limits retries to a share of normal traffic, so they switch themselves off when most calls fail. It is usually a token bucket: a counter that refills slowly and is spent by each retry. Google allows at most 3 attempts per request and retries only while they are under 10% of a client's requests: three attempts alone let load grow to "somewhere just below 3X"; the budget "reduces the growth to just 1.1x in the general case" (SRE book, ch. 21). gRPC's throttle: each failure takes 1 token, each success adds tokenRatio, no retries while tokens ≤ maxTokens/2.

Retry budgets in real libraries, and code (gRPC, Finagle, Envoy, AWS SDKs, tenacity)
WhereRuleDefault
gRPC retryThrottling (gRFC A6)Failure −1 token, success +tokenRatio; no retries while tokens ≤ maxTokens/2No default; example 10 tokens, ratio 0.1. maxAttempts above 5 is treated as 5
Finagle RetryBudget (docs)Retries up to a share of requests, plus a floor per second20% plus 10 retries a second, 10 s window
Envoy retry budget (API docs)Concurrent retries capped at a share of active requests20%, at least 3; route retries default to 1, full jitter from a 25 ms base
AWS SDKs (retry behaviour)3 attempts; a 500-token quota per client; a first-try success refunds 1 tokenBefore 2026: 5 tokens a retry, 10 after a timeout. Opt-in 2026 behaviour (AWS_NEW_RETRIES_2026=true): 14 tokens per transient retry, 5 per throttling retry, base delay 50 ms (1 s for throttling), cap 20 s

The AWS quota starts to drain when "more than approximately 22% of requests result in sustained transient failures". Brooker: the token bucket "allows all calls to retry as long as there are tokens, and then retry at a fixed rate when the tokens are exhausted. AWS added this behavior to the AWS SDK in 2016."

# Python, tenacity 9.1.4: full jitter, 3 attempts, only on transient errors from tenacity import retry, stop_after_attempt, wait_random_exponential, retry_if_exception_type @retry(stop=stop_after_attempt(3), # 1 try + 2 retries wait=wait_random_exponential(multiplier=0.1, max=2), # "Full Jitter" per its docstring retry=retry_if_exception_type((httpx.ConnectError, httpx.ReadTimeout))) def call_provider(body): ...
# gRPC service config (gRFC A6): retry policy plus the retry throttle {"methodConfig": [{"name": [{"service": "chat.Model"}], "retryPolicy": {"maxAttempts": 3, "initialBackoff": "0.1s", "maxBackoff": "1s", "backoffMultiplier": 2, "retryableStatusCodes": ["UNAVAILABLE"]}}], "retryThrottling": {"maxTokens": 10, "tokenRatio": 0.1}}

gRPC's own jitter is narrower than full jitter: each wait is the exponential value times random(0.8, 1.2) (gRFC A6). tenacity's wait_random_exponential is documented as corresponding "to the 'Full Jitter' algorithm" (source, 9.1.4).

Hedging is the retry for slowness rather than failure: a hedged request sends a second copy when the first is merely slow and takes whichever answers first. It fights the fan-out tail: if one call in 100 is slow and a page makes 100 calls in parallel, "63% of user requests will take more than one second" (1 − 0.99100 = 63.4%; Dean and Barroso, The Tail at Scale, 2013). Hedge only idempotent reads, never toward an overloaded dependency; for LLM calls it doubles GPU cost, so it is rare.

Hedging's numbers (Dean and Barroso)

Defer the second request "until the first request has been outstanding for more than the 95th-percentile expected latency", which limits extra load to about 5%. In a Google BigTable benchmark, hedging after 10 ms cut the 99.9th-percentile latency of reading 1,000 values "from 1,800ms to 74ms while sending just 2% more requests". Reducing variability itself is Capacity planning and performance's subject.

5. A retry storm, measured

Setup (code in src/lab/, Python standard library, run 2026-10-04 on an Apple M1 Pro): a real HTTP service on a local socket with 4 worker slots, each request holding a slot for 25 ms (a call through a pool of 4 connections), so about 160 requests a second. A load generator sends 100 new requests a second at random moments (open system) for 40 s, with the 100 ms client timeout chosen above and at most 3 attempts. Trigger: from second 10 to 15 each call takes 100 ms, so capacity drops to 40 a second. Like most servers, ours keeps working on a request after its client has given up. Six policies, 3 random seeds each.

Predict: which of these ends the storm once the 5-second slowdown is over?
  1. The service before anything goes wrong. 4 slots of 25 ms each: about 160 requests a second (the glass plane). About 100 new requests a second arrive at random and almost all are answered: 962 of 967 in the first 10 seconds of seed 1. Each bar is one second of HTTP attempts.
  2. The trigger, with timeouts and no retries. From second 10 to 15 each call takes 100 ms, so capacity drops to 40 a second; the queue reaches 307 and calls time out. With timeouts and no retries the service falls behind, drains its queue and recovers, 7 s after the slowdown in seed 1.
  3. Retry at once. Each timed-out request comes back up to twice more: about 300 attempts a second arrive at a service that can do 160, the queue grows without end (4,957 waiting when the run stopped) and the server answers clients who already left. Success 24.2%; it never recovers. The trigger lasted 5 seconds; the outage lasted until the experiment ended.
  4. Backoff with full jitter. The same bars: 2.515 attempts per request, exactly as with immediate retries, and a queue of 4,894. Backoff with full jitter did not help at all: in an open system each request still makes its 3 attempts, only later, so the average load is the same.
  5. The server skips expired work. The queue stays short (96 at most) because work whose deadline passed is dropped, but every retry still has to be queued and rejected: attempts stay at 2.469 per request, success 28.1%, no recovery.
  6. A retry budget. What fixed it was removing work: the budget cut retries to almost nothing once failures dominated, 1.002 attempts per request. The bars look like the run without retries, and it recovers 7 s after the slowdown.
  7. A bounded queue (shed at 8 waiting). The server answers the excess with an immediate 503, keeping the wait short enough for accepted requests to succeed: success 87.3%, back to normal 1 s after the slowdown, the best of the six.

Every run, policy by policy and seed by seed

Fig. 4 shows seed 1. The chart beside this text replays any policy and seed: answered and failed requests and HTTP attempts per second, with the server queue under them. The table gives the mean of all three seeds.

Honest limits of this experiment, and how the model was checked

One laptop, Python's asyncio, a socket on the same machine, an artificial dependency (a sleep), a small scale. A sleep overshoots: Capacity planning and performance measured about 1 ms per sleep on the same kind of laptop, so real utilisation may sit a few percent above the nominal figures (the measured 28 ms per call already includes it; the runs were not repeated). Real networks add delays and real services more layers. The direction of every result matches the sources and the Resilience lab's model: with the per-call time set to the measured 28 ms (25 ms of work plus about 3 ms of overhead, read from the baseline p50) and 103 ms in the slowdown, its "Measured" presets land within 2.5 points of the measured success and on the same recovery verdict for all six configurations (last column of the table). That agreement is by construction for the per-call time and independent for everything else.

Measured: the same 5-second slowdown under six retry policies

Success: share of the 4,000 logical requests answered on some attempt. Attempts per request: HTTP requests per logical request. Useful work: share of the server's completed work whose client was still waiting. Recovery: seconds after the slowdown until every later second answered at least 90% of its arrivals ("never" means not within the 25 s left). Mean of 3 seeds, with the range. Model: the Resilience lab engine on the same configuration and seeds.

6. Idempotency: making a retry safe

An operation is idempotent if doing it twice equals doing it once ("set the title" is; "append a message" and "charge $20" are not; HTTP defines GET, PUT and DELETE as idempotent and POST as not, RFC 9110 §9.2.2). After a timeout the client cannot tell "never arrived" from "done, reply lost", so a retry of a non-idempotent call needs an idempotency key: a client-made ID sent with every attempt, stored by the server with the result, so a repeat returns the stored result instead of a second charge (Brandur Leach, Stripe, 2017). AWS does the same with "client request tokens", and returns an error if the same token arrives with different parameters (Featonby, Builders' Library). Building it (storage, the race between two attempts, expiry, a reused key with a different body) is Service APIs' (section 4); why exactly-once is an end-to-end property is Distributed systems fundamentals section 9; consumers deduplicating is Queues, streams and async work's.

The reliability rule: no automatic retry of a non-idempotent call without a key, and read what your client libraries retry: Jepsen found the etcd Java client "jetcd incorrectly retries non-idempotent requests which may have actually succeeded" (Kingsbury, Jepsen, 2024-08-08). An LLM call is idempotent in effect (you pay twice) unless it has side effects such as tool calls that send email; those need keys at the tool.

7. Circuit breakers: stop calling what is broken

Timeouts bound how long each call to a sick dependency wastes; a circuit breaker stops making the calls: "Once the failures reach a certain threshold, the circuit breaker trips, and all further calls to the circuit breaker return with an error, without the protected call being made at all" (Fowler, 2014, crediting Michael Nygard's Release It!).

Fig. 5 runs the after design of section 8's before and after (a 100 ms timeout, a breaker that opens at 50% failures over the last 20 calls, waits 2 s and tries 5 calls, a smaller fallback model) through the same 3 s provider slowdown, in the page's simulation engine.

  1. Closed: calls go through. The breaker counts outcomes in a sliding window: here the last 20 calls (resilience4j's default: at least 50% of the last 100 calls). Before the slowdown every call succeeds in 25 ms.
  2. Failures fill the window. At second 10 the provider takes 3 s per call, so each call fails at its 100 ms timeout. Once at least half of the last 20 calls failed, the breaker trips.
  3. Open: fail fast. For a wait period (2 s here; 60 s by default in resilience4j) every call returns at once, answered by the fallback, without calling the provider. What it buys: no full timeout per call, workers freed at once, breathing room for the dependency, and the fallback runs immediately. In this run the breaker refused 315 calls, and 336 requests in all were answered by the fallback.
  4. Half-open: a few trial calls. After the wait, 5 trial calls go through (resilience4j: 10). While the provider is still slow they fail and the breaker opens again; a trial that fails sends it back to Open. It was open for 6.0 s in all, flickering through half-open every 2 s.
  5. Closed again. Once the provider recovers at second 15, the trials pass and the breaker closes; full answers return. Not one request failed in the whole run, against 403 without the defences (Fig. 1).
Envoy's "circuit breakers" are not Fowler's
Envoy's are "fully distributed (not coordinated)" concurrency caps per upstream cluster: by default 1,024 connections, 1,024 pending requests, 1,024 parallel requests and 3 parallel retries (Envoy docs). That is a bulkhead. Envoy's closest thing to a breaker is outlier detection, which ejects one bad host: after 5 consecutive 5xx, checked every 10 s, ejected for 30 s times the number of ejections, never more than 10% of the cluster at once (outlier detection API). The 10% cap stops a bad health signal from ejecting everything.

Costs and when not to. A breaker rejects calls that might have worked and adds a mode that appears only during failures; Brooker argues breakers "introduce modal behavior into systems that can be difficult to test" and prefers the retry token bucket. Do not put one breaker in front of many independent hosts or tenants (one bad shard opens it for all; use outlier detection or a breaker per host), nor on low-traffic calls where 5 failures are noise; and decide what Open returns, or an open breaker is just a faster outage.

Breaker defaults by library, and Hystrix's history
LibraryTrips whenStays openHalf-open trials
resilience4j 2.4.0 (Java, released 2026-03-14; CircuitBreakerConfig.java)≥50% of the last 100 calls failed (needs at least 100 calls); also counts slow calls (60 s, 100% threshold by default)60 s10
Polly 8 (.NET; docs)≥10% failures over 30 s, with at least 100 calls5 snot listed in the defaults table
pybreaker 1.4.1 (Python; source)5 consecutive failures60 s1 success closes it
Hystrix (Netflix; maintenance mode since 2018; configuration wiki)≥50% errors with at least 20 requests in a 10 s window5 s"allowing attempts again" (count not stated)

Hystrix's README: "Hystrix is no longer in active development, and is currently in maintenance mode"; Netflix would use "open and active projects like resilience4j for new internal projects", and its "focus has shifted towards more adaptive implementations that react to an application's real time performance rather than pre-configured settings" (README, 2018-11-19). Today the same protection often lives in a proxy such as Envoy, configured once for every service.

8. Overload: bulkheads, load shedding, degradation

A bulkhead splits capacity into pools so one consumer cannot take it all: "Isolate the elements of an application into pools so that if one element fails, the others continue to function" (Azure Architecture Center). For our chat API: model-provider calls get at most 30 of the 50 workers and their own connection pool, so a provider stall leaves 20 for login, history and billing. At larger scale it is cell isolation (the root's Case files: Shopify's "pods", so one shop's bad day stays theirs), one way to shrink blast radius. The cost is idle capacity; the mistake is pools too small for normal peaks.

  1. One shared pool. The 20 workers of the before design (end of this section) serve both kinds of request: 50 a second send a message and call the provider, 50 load history (5 ms of our own work).
  2. The provider slows; everything fails. At 3 s per call, message requests take all 20 of 20 workers; history loads queue behind them, and 175 of them fail although they never touch the provider.
  3. Two pools. Split the same 20 workers: 10 only for requests that call the provider, 10 for everything else (the engine run once per pool, 50 requests a second each).
  4. The same slowdown, contained. The provider pool fills (10 of 10) and 242 message requests fail; the other pool never notices: 0 of 2,053 history loads fail.
  5. What it costs, and what it does not fix. History needs about a quarter of one worker (50 a second × 5 ms), so its pool sits mostly idle; that idle capacity is the price. The provider pool still fails its own requests: bounding the wait (timeout, breaker, fallback; Fig. 5) is what saves those.

Load shedding and goodput

When more work arrives than a service can finish, a queue that grows without limit turns overload into latency, then timeouts, then (with retries) a metastable failure. Load shedding rejects the excess early and cheaply so accepted work still succeeds. The quantity to protect is goodput: "the subset of the throughput that is handled without errors and with low enough latency for the client to make use of the response" (Yanacek, Builders' Library).

  • Bound every queue: "it is usually better to have small queue lengths relative to the thread pool size (e.g., 50% or less)" (SRE book, ch. 22). In the measured storm a queue of 8 was the fix.
  • Reject cheaply and drop expired work: reject before parsing the body or calling anything (even iptables limits "can reject excess connections far more cheaply than any server process"); if the deadline has passed, "it can skip doing the rest of the work" (Yanacek).
  • Shed by priority: Google tags requests from CRITICAL_PLUS to SHEDDABLE and sheds from the bottom (SRE book, ch. 21); Stripe reserves "a fraction of our infrastructure for critical requests" (20%: non-critical traffic over its 80% gets 503, Tarjan, 2017). For us: paid before free, interactive chat before batch summaries.
  • Adapt the limit to measured latency instead of fixing it (details below).
Adaptive concurrency limits and client-side throttling (Netflix, Google)

Netflix's concurrency-limits treats it like a TCP congestion window with Little's law, "Limit = Average RPS * Average Latency" (README), shrinking it as latency rises above the no-load latency (Netflix, 2018, archived). Google's clients throttle themselves, rejecting locally with probability max(0, (requests − K × accepts) / (requests + 1)), K = 2 (ch. 21).

Past capacity, an unbounded queue's goodput collapses; a bounded one holds

The measured experiment's service (4 slots of 28 ms, so 143 calls a second; 100 ms client timeout; no retries, no slowdown), run by the Resilience lab engine at each load. At 200 a second: 0.7 against 143.1 good answers a second. Yanacek: "If load shedding is working, goodput will remain steady even as offered throughput increases well beyond the scaled capabilities of the service".

Graceful degradation

Graceful degradation goes further: serve "responses that are not as accurate as or that contain less data than normal responses, but that are easier to compute" (ch. 21). A brownout switches optional features off under load (Amazon's load-shedding essay uses the word for the overload state itself). Decide the ladder in advance:

FullLarge model, retrieval, tools
→
LighterSmaller or other provider's model
→
LeanerNo retrieval, shorter context
→
CachedCommon questions
→
Honest error"Busy, try in a minute", fast

Each rung needs a switch an operator can flip in seconds (an ops toggle or kill switch, Fowler and Hodgson, Feature Toggles) and a test: code that only runs in emergencies is the least tested you own, so run "a small subset of servers near overload in order to exercise this code path" (SRE book). Do not degrade where a wrong answer is worse than none (a payment, a dosage).

Same deterministic engine as the Resilience lab, which lets you change every one of these settings.

Before and after: one slowdown, two designs

Same event through two versions of our chat API: half the requests need the provider (send a message), half do not (load history); 20 worker slots; users give up after 2 s; at second 10 the provider takes 3 s per call instead of 25 ms, for 5 seconds. Before: no timeout on the provider call, no breaker, unbounded queue. After: 100 ms timeout, a breaker (opens at 50% failures over the last 20 calls, waits 2 s, tries 5 calls), a fallback answer (a smaller model) and a queue bounded at 40. Watch the worker strip: in Before, history loads fail although they never touch the provider. Each step plays a stretch of seconds.

  1. Seconds 7 to 9: normal traffic. 100 requests a second: half send a message (need the provider, 25 ms), half load history (5 ms of our own work). 20 workers are plenty; nothing waits.
  2. Second 10: the provider slows to 3 s per call. With no timeout, each message request holds a worker for 3 s. At 50 such requests a second, all 20 workers are stuck within half a second.
  3. Seconds 11 to 14: the cascade. Every worker waits on the provider, so history loads, which never needed it, queue behind them too. The queue grows by about 100 a second and everyone waits past 2 s.
  4. Second 15: the provider recovers. Calls started before second 15 still take 3 s, and the queue holds hundreds of requests whose users already gave up; we still process them.
  5. Seconds 16 to 21: draining. The backlog is worked off, mostly for users who left; then service is normal again.
  6. Totals. Before: 89.8% of all requests answered in time; 403 failed, 175 of them history loads that never needed the provider. Switch to After to run the same slowdown with the defences on.

9. Rate-limit algorithms: per-client fairness

Shedding protects the service from the total; a rate limit protects it from one client, and other clients from that client: each API key, user or tenant gets a rate such as 10 requests a second, and the rest get 429 Too Many Requests, ideally with Retry-After (RFC 6585 §4). LLM APIs limit tokens per minute as well, because one request can cost 100 times another. This page owns the algorithms; how an API exposes limits (headers, quotas, tiers) is Service APIs', and budgets at an LLM gateway are Gateways and routing'.

  • Fixed window: count per calendar second, reset at each boundary. One counter, but a client can send the limit just before and again just after the boundary: twice the limit within one real second.
  • Sliding log: remember every accepted request's time and count the last second. Exact; memory grows with the limit.
  • Sliding window counter: this window's and the previous window's counts, assuming the previous was spread evenly. Cloudflare: 42 requests last minute, 18 so far in a minute that started 15 s ago gives 42 × (45/60) + 18 = 49.5; over 400 million requests "0.003% of requests have been wrongly allowed or rate limited", with "an average difference of 6% between real rate and the approximate rate" (Cloudflare, 2017).
  • Token bucket: up to B tokens, refilled at R per second, one per request. Bursts up to B, average R. Stripe: "We use the token bucket algorithm to do rate limiting", in Redis; standardised in networking as early as RFC 2697 (1999), refilled "CIR times per second" (RFC 2697).
  • Leaky bucket (as a queue): requests wait in a bounded queue drained at a fixed rate; smooth output at the cost of delay, like Linux's token bucket filter, which "is a pure shaper" (tc-tbf(8)). "Leaky bucket as a meter" is equivalent to a token bucket; GCRA, used by some Redis limiters, is that form.

In production: at the edge (gateway, Envoy, Cloudflare) or in a shared store (Redis, with check-and-decrement atomic in one Lua script so two servers cannot both take the last token; the script, and three limiter algorithms measured on Redis, are on NoSQL in practice, section 3); per tenant and per expensive resource (tokens per minute per model). Make your own clients obey 429 with jitter: the root's Case files include Cloudflare's September 2025 dashboard outage, where its own dashboard overwhelmed its API.

Stripe's four limiters (2017)

Stripe runs four limiters: a request rate limiter ("by far the most important one"), a concurrent-requests limiter ("You can only have 20 API requests in progress at the same time") and two load shedders, and warns: "Make sure you have kill switches to disable the rate limiters should they kick in erroneously" (Tarjan, Stripe, 2017).

The same 7 seconds of one client's traffic through each limiter (limit: 10 per second)
acceptedrejected (429)accepted after waiting (line shows the wait)

Illustrative fixed trace: 5 a second, then 10 just before and 10 just after the 3-second boundary, then a burst of 25 at 4.5 s. "Most in any 1 s" counts accepted requests in the busiest sliding second, what the dependency behind the limiter feels: the fixed window lets 20 through, the token bucket 15. Checked by src/recompute.py.

10. Health checks done right

A health check is a request a load balancer or orchestrator sends to decide whether a server gets traffic or a restart. AWS separates liveness ("basic connectivity to a service and the presence of a server process"), local (disk, config) and dependency checks ("a thorough inspection of the ability of an application to interact with its adjacent systems"; Implementing health checks). Kubernetes has liveness, readiness and startup probes (startup holds the others off while a model server loads weights); defaults: every 10 s, 1 s timeout, 3 failures to fail, 1 success to pass (Kubernetes docs).

Three outage patterns. Liveness that checks the database: a slow minute fails every pod, all restart, and the stampede (cold caches, new connections) keeps the database down. Every host unhealthy at once: the problem is shared, so removing every host guarantees an outage (Meta's October 2021 outage in the root's Case files: a health rule correct for one site withdrew every data center). A /health cheaper than real work: 200 while real requests fail is gray failure by design; pair it with user-side SLIs.

What each failure does decides what each probe may check

Kubernetes: "Incorrect implementation of liveness probes can lead to cascading failures"; "the liveness probe passes when the app itself is healthy, but the readiness probe additionally checks that each required back-end service is available." AWS: "when all servers fail health checks at the same time, the load balancer fails open, allowing traffic to all servers"; Envoy's 10% ejection cap is the same idea.

11. Deployment safety: most outages are changes

"SRE has found that roughly 70% of outages are due to changes in a live system"; the remedies are "progressive rollouts", "quickly and accurately detecting problems" and "rolling back changes safely when problems arise" (SRE book, ch. 1). A change is code, config, flags, model versions, prompts, dependency upgrades and infrastructure. The lever is blast radius: a canary releases to a small slice first, and if a bad build fails 20% of requests, a 5% canary gives "a 1% overall error rate" (SRE workbook, Canarying releases); it should be "sizeable and last long enough to be representative", and "We strongly advise running only one canary deployment at a time."

Feature flags ship code switched off and turn it on separately. Fowler and Hodgson's four kinds: release toggles (latent code "which may never be turned on"), experiment toggles (A/B tests), ops toggles ("disable or degrade that feature quickly in production"), permissioning toggles (Feature Toggles). A flag flip is itself a change. Config is code: the root's Case files hold four outages from config or content pushed everywhere at once: Cloudflare's November 2025 proxy crash from a doubled feature file, Cloudflare's 2026 follow-up that now rolls config out like code, CrowdStrike's July 2024 content update that crashed 8.5 million PCs, and Knight Capital's 2012 deploy that reached seven of eight servers. Model and prompt changes (shadow traffic, canaries judged by evals, A/B tests) are Production eval engineering's.

Waves, each baked before the next

AWS deploys first to a "one-box" stage ("a single virtual machine or single container"), then in waves of increasing size: "A typical pipeline waits at least one hour after each one-box stage, at least 12 hours after the first regional wave" (Liguori, Automating safe, hands-off deployments). The wait is bake time; a high-severity alarm is used "to page the oncall engineer and to automatically roll back the service if a deployment is in progress" (automatic rollback: roll back first, debug later).

12. SLIs, SLOs and error budgets: how reliable is enough

From the SRE book (ch. 4): an SLI is "a carefully defined quantitative measure of some aspect of the level of service that is provided", best written as "the number of good events divided by the total number of events" (SRE workbook, ch. 2); an SLO is "a target value or range of values for a service level that is measured by an SLI", by default over "a four-week rolling window" (whole weeks, "so it always contains the same number of weekends"); an SLA is a contract "that includes consequences of meeting (or missing) the SLOs" ("if there is no explicit consequence, then you are almost certainly looking at an SLO"). S3 keeps the gap on purpose: designed for 99.99% availability, with "an availability SLA of 99.9%" (S3 storage classes).

The workbook's menu for request-driven services is availability, latency and quality (responses "served in an undegraded state"); for pipelines freshness, correctness and coverage; for storage durability; "five or fewer" SLI types. A first set for the chat assistant, measured at the load balancer or in the app:

User journeySLI (good / valid events)SLO, 28 days
Send a messageReplies that start streaming without a 5xx or a timeout / messages sent99.9%
Send a message (latency)Replies whose first token arrives within 2 s / messages sent95% (percentiles, not the mean: the book prefers "percentiles rather than the mean")
Send a message (quality)Replies served by the full model, not a fallback rung / messages sent99%
Load historyHistory loads without error within 500 ms / loads99.95%
Saved messagesMessages that can be read back / messages saved (durability)far more nines; checked by restore tests

Targets illustrative. Keep the external promise looser than the internal target: "Using a tighter internal SLO than the SLO advertised to users gives you room to respond to chronic problems" (ch. 4). Serving-level SLOs for an LLM endpoint (time to first token, time per output token, goodput) are LLM serving in production's.

The error budget is "100% minus the SLO" (workbook). At 10 million messages a day and 99.9% it is 10,000 failed messages a day, 300,000 per 30 days (the SRE book's own: "a system that serves 2.5M requests in a day with a daily availability target of 99.99% can serve up to 250 errors"). It turns arguments into arithmetic: while budget remains, "new releases can be pushed"; when it is spent, "releases are temporarily halted" (ch. 3). Google's example policy: "halt all changes and releases other than P0 issues or security fixes until the service is back within its SLO", and any incident using more than 20% of the budget gets a postmortem with at least one top-priority action item; "This policy is not intended to serve as a punishment for missing SLOs" (Example error budget policy, 2018).

Alerting on the budget: burn rate

"Error rate above 0.1%" pages for blips and misses slow leaks. The burn rate is "how fast, relative to the SLO, the service consumes the error budget"; at 99.9% over 30 days "a constant 0.1% error rate uses exactly all of the error budget: a burn rate of 1" (SRE workbook, ch. 5). Its starting point pages on 2% of the budget in one hour or 5% in six hours and tickets at 10% in three days; since share spent = burn rate × window / period, the thresholds follow:

Each alert checks a long window (is it real?) and a short one, "1/12 the duration of the long window" (is it still happening?), so the page stops soon after the problem does. Predict before you play: does a 5-minute spike of 10% errors page anyone?

Low traffic breaks burn-rate alerts: at 10 requests an hour one failure is a 10% error ratio and 1 ÷ 7.2 = 13.9% of a 30-day budget at 99.9%. A slip to know: the workbook's low-traffic example calls that one failure "a 1,000x burn rate", but 10% ÷ 0.1% = 100x (its 13.9% is right). Building these alerts as tested Prometheus rules, and the workbook's six alerting approaches played against the same incidents, is the Observability page's Alert lab.

Play an incident against the workbook's alerts

The incident and the alerts (time from the start of the incident)

Error budget left over the 28-day window (incident on day 14)

The spike spends about 1% of the budget and pages nobody; a 30-minute full outage pages after one minute (it burns 1,000 times too fast); the 4-day slow leak never pages, tickets after about 1.3 days, yet spends a large share of the month. Move the SLO to 99.99% and the same incident becomes an emergency. Budget = (1 − SLO) × requests in the window; burn rate = error ratio / (1 − SLO); share spent = burn rate × duration / window. Window: 28 days, the workbook's "four-week rolling window" (its thresholds are quoted for 30 days; over 28 days they spend 7% more budget, shown rather than hidden). An alert fires when the error ratio over both its windows exceeds threshold × (1 − SLO), minute by minute; requests are spread evenly over the day (a night-time incident spends less). Checked by src/recompute.py.

13. Incidents and postmortems

An incident is an unplanned event that hurts or threatens users and needs coordinated work. Declare one if any holds: "Do you need to involve a second team in fixing the problem? Is the outage visible to customers? Is the issue unsolved even after an hour's concentrated analysis?"; "It is better to declare an incident early and then find a simple fix and close out the incident than to have to spin up the incident management framework hours into a burgeoning problem" (SRE book, ch. 14).

DetectAn SLO burn alert pages on-call
→
DeclareName an IC, open a channel and a doc, set severity
→
MitigateStop the harm first: roll back, flip the flag, shed load, fail over
→
CommunicateStatus page and stakeholders, on a fixed rhythm
→
ResolveSLI back; close; schedule the postmortem

Mitigate before you understand: if a deploy went out an hour ago, roll it back now. Name the roles at once: an incident commander who coordinates and does not fix, an operations lead who alone changes the system, a communications lead, and a scribe (details below). An update can be one line: "Some replies are failing. We have rolled back a recent change and are watching recovery. Next update 14:30 UTC." PagerDuty: "Never hesitate to page the IC" (During an incident).

Incident roles, in their sources' words

Roles, from the Incident Command System used by fire services (the workbook's "three Cs": coordinate, communicate, maintain control, ch. 9): the incident commander "holds the high-level state about the incident" and is "NOT a resolver" (PagerDuty roles); the operations lead: "The operations team should be the only group modifying the system during an incident"; the communications lead issues "periodic updates"; the scribe "documents the timeline", since the IC's "most important responsibility is to keep a living incident document" (SRE book).

A postmortem is the written account: what happened, why, what will change. Google writes one for user-visible downtime beyond a threshold, any data loss, any on-call intervention such as a rollback, a long resolution or a monitoring failure (SRE book, ch. 15). Blameless: "identifying the contributing causes of the incident without indicting any individual or team", because "You can't 'fix' people, but you can fix systems and processes"; Allspaw (Etsy, 2012): without accounts given "without fear of punishment or retribution" the organisation never learns how it happened, which "all but guarantees that it will repeat" (Code as Craft, archived). Headings from the book's example postmortem (Shakespeare search, "down for 66 minutes", ending "Freeze production until 2015-11-20 due to error budget exhaustion"): Summary, Impact, Root causes (the sustaining effect, not just the trigger), Trigger, Resolution, Detection, Action items (type, owner, bug), Lessons learned (what went well, wrong, where we got lucky), Timeline.

A short example on the running product illustrative incident

Summary. For 23 minutes, 31% of chat replies failed. Impact. About 50,000 failed messages: 17% of the 30-day error budget at 99.9% and 10 million messages a day. Trigger. The provider's latency rose from 1 s to 20 s in one region for 4 minutes. Root causes. (1) a 60 s provider timeout, so workers filled; (2) the app, the API and the gateway each retried 3 times (27 attempts per message), keeping the provider overloaded after its incident ended, a metastable failure; (3) history shared the worker pool and failed too. Detection. The 14.4x burn-rate page fired 5 minutes in. Resolution. Kill switch to the fallback model; retries drained. Action items. 5 s time-to-first-token timeout; retries only in the API, with a 10% budget; a separate pool for history; a breaker with the fallback as its open state; a monthly game day on the fallback. Where we got lucky. The fallback provider had spare capacity.

Postmortem mistakes: "human error" as the root cause (it is where the investigation starts); stopping at the trigger; action items nobody owns; Five Whys chains that pick one linear story out of several causes; skipping near misses, which teach the same lessons for free.

Severity levels (PagerDuty's five, Atlassian's three)
PagerDuty level (severity levels)DefinitionChat assistant example
SEV-1"Critical issue that warrants public notification and liaison with executive teams."No one can send messages
SEV-2"Critical system issue actively impacting many customers' ability to use the product."Replies fail for 20% of users, or all paid users
SEV-3"Stability or minor customer-impacting issues that require immediate attention from service owners."Fallback model serving for an hour
SEV-4"Minor issues requiring action, but not affecting customer ability to use the product."Error budget burning at 1x for days
SEV-5"Cosmetic issues or bugs, not affecting customer ability to use the product."Wrong icon on the status page

PagerDuty's rule when unsure: "treat it as the higher one. During an incident is not the time to discuss or litigate severities." Atlassian uses three levels (SEV 1 to 3) and pages on-call only for SEV 1 and 2 (Atlassian). Atlassian's postmortem template adds leadup, backlog check and recurrence (templates).

14. LLM calls: what is different

Every mechanism above applies to a model provider, with four differences that change the numbers.

  • The provider is the weakest link and you do not control it. At two to three nines (section 1), it sets the chat API's ceiling unless the call is optional: a fallback rung (another provider, a smaller model, a cached answer) is what lifts availability above the provider's. Routing, cooldowns and fallback chains across providers are Gateways and routing's; this page's job is the breaker that decides when to use them and the test that proves they work.
  • Overload has its own codes. Anthropic's API returns 529 overloaded_error, which "can occur when the API experiences high traffic across all users", separate from 429 for your own rate limit (Anthropic API errors); OpenAI returns 503 with code server_is_overloaded: "Follow the Retry-After header when it's present" (OpenAI error codes). A 529 or 503 means the dependency is not healthy, which is exactly when a retry budget and a breaker should stop retrying.
  • SDKs retry for you. Anthropic's SDK "automatically retries transient failures (such as connection errors, rate limits, and 5xx server errors) with exponential backoff, twice by default" (same page). Wrap it in your own 3 attempts and one call becomes up to 9; set max_retries so only one layer retries.
  • Latency is long and streamed. A reply can take tens of seconds, and when "receiving a streaming response over server-sent events (SSE), an error can occur after the API returns a 200 response" (Anthropic). Anthropic advises streaming or batches for requests "especially those over 10 minutes", since "Some networks might drop idle connections". So a total timeout is the wrong tool:

Retries cost money and quota. A retried completion is billed again and spends tokens-per-minute quota, so a retry storm against a provider can turn into a 429 storm on your own account. Budget retries (section 4), cap concurrency per provider (a bulkhead), and alert on the share of replies served by fallback rungs (the quality SLI of section 12).

One long reply under three timeout designs

Illustrative times: first token at 1.5 s, a healthy reply streaming to 48 s. A time-to-first-token timeout catches a provider that never starts; an idle timeout between tokens catches a stall; neither kills a long healthy answer. Long-tail latency is also why hedging is rare here: a second copy doubles GPU cost.

15. Chaos testing: when it pays

Fallbacks, breakers and failovers run only during failures, so they rot unless failure is made on purpose. "Chaos Engineering is the discipline of experimenting on a system in order to build confidence in the system's capability to withstand turbulent conditions in production" (Principles of Chaos Engineering, March 2019). Its principles: build a hypothesis around steady-state behaviour, vary real-world events, run experiments in production ("Chaos strongly prefers to experiment directly on production traffic"), automate them to run continuously, and minimise blast radius ("Experimenting in production has the potential to cause unnecessary customer pain"). Netflix's Chaos Monkey "randomly terminates virtual machine instances and containers that run inside of your production environment" (README), by default only on weekdays between 9 and 15 local time (configuration), when engineers are there to watch.

When it pays: once the defences exist and the SLIs can see the effect (an experiment with no steady-state metric proves nothing), when there is redundancy to test (replicas, a second provider), and when the error budget can absorb the experiment. Start with a game day in office hours on staging or a canary slice: kill the provider connection and watch whether the breaker opens and the fallback rung serves. When it does not: a single-instance service with no fallback (the answer is known: it goes down), a team without on-call or rollback, or a budget already spent. Fault injection in tests (a mock dependency that hangs or returns 529) catches most of the same bugs earlier and cheaper; testing practice is Testing and quality's.

Depth and reference

A starting configuration for a service like our chat API (defaults to beat, not laws)
MechanismStarting pointWhy
TimeoutsEvery outbound call; about p99.9 of the dependency plus padding; connect timeout well under a second; deadline passed downBrooker's percentile rule; gRPC and SRE book on deadlines
RetriesAt one layer only; 3 attempts in all; full jitter from a 50 to 100 ms base; only transient errors on idempotent callsAWS SDK and tenacity defaults; Envoy jitters by default
Retry budgetAbout 10% of requests (gRPC throttle 10 tokens, ratio 0.1; Finagle 20%; Envoy 20%)SRE book ch. 21; the measured storm
Circuit breakerPer dependency (per host if hosts fail independently); about 50% failures over enough calls; open 5 to 60 s; a defined fallbackresilience4j, Polly, Hystrix defaults
BulkheadsSeparate worker and connection pools per critical dependency; per-cluster concurrency caps in the proxyEnvoy defaults (1,024 each) are a ceiling, not a design
QueuesBounded, at most about half the worker count; drop expired work; shed lowest priority firstSRE book ch. 21 and 22; Stripe's shedders
Rate limitsToken bucket per tenant at the edge, in Redis or the gateway; tokens per minute for LLM calls; 429 with Retry-AfterStripe; Cloudflare
Health checksLiveness: process answers. Readiness: dependencies. Fail open when everything failsKubernetes docs; Builders' Library
DeploysOne box, then waves with bake time; automatic rollback on alarms; config and flags rolled out the same wayLiguori; SRE workbook ch. 16
SLOsTwo to five SLIs per user journey, 28-day window, burn-rate alerts at 14.4x/1 h and 6x/6 h (page), 1x/3 d (ticket)SRE workbook ch. 2 and 5
PracticeGame days and fault injection in office hoursNetflix Chaos Monkey (2011, in the root's Case files)

The habits behind the table, as the old Distributed Systems Basics page put them: make every mutation idempotent, bound every queue, jitter every retry (and budget it), and name the failure you are defending against when you add a component. Where these live: in the client library (tenacity, resilience4j, Polly, the AWS SDKs, gRPC service config), in a sidecar or gateway (Envoy, Istio, an LLM gateway), or in the platform (Kubernetes probes, deployment controllers). A proxy gives one consistent policy; code knows what is idempotent. Many teams do both, and must then make sure only one layer retries.

Glossary (every term defined on this page)
Availability: share of time or requests the service works.
Durability: saved data stays saved.
Correctness: the answer is right, not just returned.
Open system: new work arrives whatever the system does.
Trigger / sustaining effect: what pushes a system into a bad state / what keeps it there.
Percentile: p99.9 is the latency 99.9% of calls beat.
Timeout, deadline, deadline propagation: longest wait; absolute end time; passing the remaining time down.
Retry, exponential backoff, jitter: send again; wait longer each time; randomise the wait.
Retry budget, token bucket: retries capped at a share of traffic; a refilling allowance.
Hedged request: a second copy sent when the first is slow.
Idempotent, idempotency key: twice equals once; a client-made ID that marks a repeat.
Circuit breaker, outlier detection: stop calling a failing dependency; eject one bad host.
Bulkhead, load shedding, goodput: separate pools; reject excess early; useful timely answers per second.
Graceful degradation, brownout, kill switch: a cheaper answer; optional features off; a flag that turns a feature off in seconds.
Rate limit: a cap per client, answered with 429; fixed window, sliding log, sliding window counter, token bucket, leaky bucket are its algorithms.
Health check, liveness / readiness: a probe; restart it / stop sending it traffic.
Canary, waves, bake time, rollback, feature flag: a small first slice; growing stages; the wait between them; back to the last good version; a switch that turns code on without a deploy.
SLI / SLO / SLA, error budget, burn rate: measure / target / contract; 100% minus the SLO; how fast it is spent (1 = exactly on time).
Incident, postmortem (blameless): an unplanned event needing coordinated response; the written account, aimed at systems not people.