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.
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'.
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.
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.
Allowed downtime = (1 − target) × period; the SRE book's availability table gives the same values with a 30-day month.
The parent's example figures; product 99.24%. The parent's Numbers to know tab has a calculator for chains like this.
The process dies; connections are refused at once. Easy to detect and route around.
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.
One shard, zone or kind of request fails. Averages hide it: 1% of users completely broken looks like a 99% healthy service.
Health checks say "fine" while users see failures: "differential observability" (Huang et al., HotOS 2017). Defence: measure from the user's side (SLIs).
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.
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.
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."
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.
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).
X-Deadline).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).
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".
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).
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".
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.
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.
| Where | Rule | Default |
|---|---|---|
gRPC retryThrottling (gRFC A6) | Failure −1 token, success +tokenRatio; no retries while tokens ≤ maxTokens/2 | No 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 second | 20% plus 10 retries a second, 10 s window |
| Envoy retry budget (API docs) | Concurrent retries capped at a share of active requests | 20%, 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 token | Before 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."
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.
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.
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.
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.
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.
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.
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.
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.
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.
| Library | Trips when | Stays open | Half-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 s | 10 |
| Polly 8 (.NET; docs) | ≥10% failures over 30 s, with at least 100 calls | 5 s | not listed in the defaults table |
| pybreaker 1.4.1 (Python; source) | 5 consecutive failures | 60 s | 1 success closes it |
| Hystrix (Netflix; maintenance mode since 2018; configuration wiki) | ≥50% errors with at least 20 requests in a 10 s window | 5 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.
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.
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).
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).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).
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 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:
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.
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.
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'.
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 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).
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.
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.
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.
"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.
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).
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 journey | SLI (good / valid events) | SLO, 28 days |
|---|---|---|
| Send a message | Replies that start streaming without a 5xx or a timeout / messages sent | 99.9% |
| Send a message (latency) | Replies whose first token arrives within 2 s / messages sent | 95% (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 sent | 99% |
| Load history | History loads without error within 500 ms / loads | 99.95% |
| Saved messages | Messages 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).
"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.
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.
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).
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).
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.
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.
| PagerDuty level (severity levels) | Definition | Chat 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).
Every mechanism above applies to a model provider, with four differences that change the numbers.
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.max_retries so only one layer retries.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).
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.
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.
| Mechanism | Starting point | Why |
|---|---|---|
| Timeouts | Every outbound call; about p99.9 of the dependency plus padding; connect timeout well under a second; deadline passed down | Brooker's percentile rule; gRPC and SRE book on deadlines |
| Retries | At one layer only; 3 attempts in all; full jitter from a 50 to 100 ms base; only transient errors on idempotent calls | AWS SDK and tenacity defaults; Envoy jitters by default |
| Retry budget | About 10% of requests (gRPC throttle 10 tokens, ratio 0.1; Finagle 20%; Envoy 20%) | SRE book ch. 21; the measured storm |
| Circuit breaker | Per dependency (per host if hosts fail independently); about 50% failures over enough calls; open 5 to 60 s; a defined fallback | resilience4j, Polly, Hystrix defaults |
| Bulkheads | Separate worker and connection pools per critical dependency; per-cluster concurrency caps in the proxy | Envoy defaults (1,024 each) are a ceiling, not a design |
| Queues | Bounded, at most about half the worker count; drop expired work; shed lowest priority first | SRE book ch. 21 and 22; Stripe's shedders |
| Rate limits | Token bucket per tenant at the edge, in Redis or the gateway; tokens per minute for LLM calls; 429 with Retry-After | Stripe; Cloudflare |
| Health checks | Liveness: process answers. Readiness: dependencies. Fail open when everything fails | Kubernetes docs; Builders' Library |
| Deploys | One box, then waves with bake time; automatic rollback on alarms; config and flags rolled out the same way | Liguori; SRE workbook ch. 16 |
| SLOs | Two 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 |
| Practice | Game days and fault injection in office hours | Netflix 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.
A simulated service under a dependency slowdown. Users send requests to our service (worker slots and a queue); some requests call a dependency (its own slots, queue and latency). From second 10 the dependency slows down; you choose how the service defends itself and watch what users get. Everything is computed in your browser by the same engine as the Reading's animation, one millisecond per step, deterministic for a given seed.
src/engine.py is a line-by-line Python port; src/check_engine.mjs runs this page's engine on the 8 presets and 30 random settings and compares every series and total exactly (0 differences). The six "Measured" presets are the configuration of the real experiment in the Reading; their outcome is compared with the 3 measured runs above the charts.Times are estimates for a careful first read. Links checked 2026-10-04 (sources added 2026-10-24 checked that day); Amazon Builders' Library essays now live on builder.aws.com (the old aws.amazon.com/builders-library addresses redirect).
Set timeouts, retries, jitter, budgets, breaker thresholds and queue limits against a dependency slowdown and watch goodput. About 20 min to explore.
The error budget card: SLO arithmetic and the workbook's burn-rate alerts played against four incidents. About 10 min.
The root: one request to an LLM product from 1 user to 10 million. Its Step 4 is the five-minute version of this page; its Scale simulator has a retry storm toggle; Numbers to know has the availability calculator; Case files has 33 real outages and designs, many cited here. About 21 min.
The service behind the API: how one Python service waits (async, threads, workers, measured), health checks and graceful shutdown (sections 6 and 9). About 32 min.
Replication, partitioning, consistency, consensus: why "the database failed over" is never simple. About 46 min.
Delivery semantics, dead-letter queues, backpressure across a queue, the outbox pattern. About 40 min.
Logs, metrics, traces and alerting: how the SLIs on this page are actually measured. About 39 min.
Load balancing, caching, queueing theory and load testing: how many servers so that shedding is rare. About 39 min.
LLM-specific failure: GPU capacity in big blocks, routing, provider failover. About 28 min.
Tests and CI: the cheapest place to catch the change that would have caused the outage. About 46 min.
Readable code, abstractions, refactoring in small tested steps, code review, library design. About 42 min.
Seven complete designs, from requirements and an estimate to the bottlenecks: interview practice. About 41 min.
Shadow traffic, canaries judged by evals, A/B tests for model and prompt changes. About 30 min.
The single best short essay on this page's core. Archived copy (the new site renders text by script). About 15 min.
The simulation behind full jitter. About 10 min.
Six pages that name the failure mode behind most long outages. About 25 min.
22 real incidents dissected; retries sustain more than half. About 1 h.
Goodput, cheap rejection, priorities. About 20 min.
Liveness, local and dependency checks; failing open. About 20 min.
One-box, waves, bake time, automatic rollback, as AWS does it. About 25 min.
Embracing risk, SLOs, managing incidents, postmortem culture, handling overload, cascading failures. About 3 h for these six.
Implementing SLOs, alerting on SLOs (the burn-rate tables), incident response. About 2 h.
Why dependencies need an extra nine, and why detection time dominates. About 25 min.
Fan-out, tail latency and hedged requests. About 30 min.
Four limiters in production, with code. About 15 min.
The sliding window counter and its measured error. About 10 min.
A complete, precise retry design: policy, throttling, hedging, commit points. About 30 min.
One page: steady state, real-world events, production, automation, blast radius. About 5 min.
Free, practical handbook: severities, roles, what to do during and after. About 1 h.
Why blame makes systems less safe. About 10 min.
Controlled delay and adaptive LIFO queues under overload. Not checked for this page (the site refused access). About 25 min.
The book that named circuit breakers and bulkheads; its stability patterns chapter is the classic. Publisher page. About 10 h.
LiteLLM, OpenRouter: retries, cooldowns and fallback chains across LLM providers, and budgets at the gateway. Its own page.
REST, gRPC, GraphQL and load balancing; rate limits as an API surface. Its own page.
The GPU serving layer whose failures (cold starts, KV memory) sit under the chat API. Its own topic.
Kubernetes, schedulers and the platform that runs the probes and rollouts. Its own topic.
TCP, TLS and HTTP: connection timeouts, keep-alive and what a reset means. Its own topic.
Runtime safety checks for LLM output, another stage that can fail open or closed. About 39 min.