Phase 05/Operating a distributed serving fleet/Inference reliability engineering (SRE)
PHASE 05 · Operating a distributed serving fleet

Inference reliability engineering (SRE)

0%
10 h7 subtopics3 lessons · 3 required
In plain English

Building a serving system is half the job. The other half is keeping it running at three in the morning when a machine dies, a new model version misbehaves or traffic doubles. Reliability engineering turns that into a discipline. You write down what "working" means as numbers (for example, 99 percent of answers start within half a second), you measure it all the time, you alarm only when the promise is in real danger, and when something breaks you write an honest report about why and change the system so it cannot break the same way twice. Think of it as a hospital's emergency department: triage rules decide who gets seen first, monitors alarm on vital signs rather than on every blip, and every serious incident ends in a case review that changes the protocol. This topic gives you those tools for a GPU inference fleet, then makes you run a drill.

Why it matters

Nineteen of the forty-six job descriptions ask for on-call, incident response or SLO ownership, and the same number ask for observability. Inference has its own failure vocabulary (Xid errors, NCCL hangs, KV exhaustion, stuck transfers) and its own SLIs (TTFT, ITL, goodput); an engineer who can define them, alert on them and lead a postmortem is trusted to carry the pager.

Hiring signal

Together AI's inference reliability engineer posting says you will own SLOs and error budgets for inference serving, lead incident response and turn postmortem lessons into controller and automation changes rather than updated runbooks; Cerebras asks for fault isolation, graceful degradation and automated recovery across the serving stack.

Skills this topic builds, with the number of the 46 analysed job postings that ask for each. Companies asking: Anthropic, Baseten, Cerebras, Cohere, CoreWeave, Crusoe, Cursor, Databricks, ElevenLabs, Fireworks, Liquid AI, Modal, nvidia, OpenAI, Perplexity, Poolside, Thinking Machines, Together AI, xAI.See all skills →

Learning objectives

  • Define SLIs and SLOs for an LLM endpoint (TTFT, ITL, availability, goodput) and derive an error budget from them.
  • Build Prometheus alerting rules that page on error-budget burn rate rather than raw thresholds, with a Grafana dashboard behind them.
  • Run a chaos drill that kills a replica behind a router and measure user-visible impact with and without graceful degradation.
  • Design degradation modes (load shedding, max_tokens caps, model fallback) and the triggers that activate them.
  • Write an on-call runbook and a blameless postmortem for the drill in the format production teams use.

Key concepts

SLI, SLO, SLA
An indicator you measure (TTFT p99), an objective you commit to internally (under 500 ms for 99 percent of requests over 30 days), and a contract with penalties.
Error budget
The allowed failure implied by an SLO (1 percent of 30 days is 7.2 hours); spent by incidents and by risky rollouts.
Burn-rate alert
Alerting when the budget is being consumed faster than a multiple of the sustainable rate over two windows, which pages on real trouble and ignores blips.
Golden signals for inference
Traffic, errors, latency (TTFT and ITL percentiles) and saturation (requests waiting, KV cache utilisation), plus preemptions.
Graceful degradation
Keeping the service partly useful under stress by shedding load, shrinking max_tokens, disabling expensive features or routing to a smaller model.
Load shedding and backpressure
Rejecting work early with 429 or 503 when queues exceed a bound so the fleet stays inside its latency SLO for the requests it accepts.
Runbook
The step-by-step document an on-call engineer follows for a specific alert, including how to confirm, mitigate and escalate.
Blameless postmortem
A written incident analysis focused on systems and timelines, with action items that change code or automation.
Xid error
NVIDIA driver error codes (for example Xid 79, GPU fell off the bus) that are the usual root cause behind a sudden replica loss.

Subtopics

  1. 1. SLIs and SLOs for LLM serving

    Choosing percentiles and windows, separating streaming TTFT from ITL, availability as fraction of good requests, goodput as the composite; differentiated SLOs across model pools.

  2. 2. Error budgets and burn-rate alerting

    Deriving budgets, multi-window multi-burn-rate rules, alert fatigue, and why static thresholds on GPU utilisation are wrong for inference.

  3. 3. Metrics stack from vLLM to Grafana

    vLLM /metrics names, Prometheus scrape config, recording rules for percentiles, Grafana dashboards, DCGM exporter for Xid and thermal signals.

  4. 4. Failure catalogue of GPU inference

    Xid and ECC faults, NCCL watchdog timeouts, KV cache exhaustion and preemption storms, OOM on long prompts, stuck KV transfers, bad model rollouts, noisy neighbours.

  5. 5. Graceful degradation and load shedding

    Admission control by queue depth, max_tokens caps, feature switches, fallback to a smaller model, circuit breakers between router and replicas.

  6. 6. Safe rollouts

    Canary and blue/green for new engine versions and model weights, automatic rollback on SLO burn, deploy freezes while the budget is exhausted.

  7. 7. Incident response and postmortems

    Roles during an incident, communication cadence, timeline reconstruction from metrics and logs, action items that change automation, review culture.

Resources

Hands-on lessons

L1

SLOs and burn-rate alerts on vLLM-style metrics with Prometheus and Grafana in Docker

CPU · your Maccli150 minrequired

Goal · A docker compose stack with three stub replicas exporting vLLM metric names, Prometheus recording and burn-rate alerting rules for a TTFT SLO and an availability SLO, and a Grafana dashboard showing budget remaining.

  1. 1Extend stub_server.py from the resilience topic so its /metrics exposes vllm:time_to_first_token_seconds (histogram), vllm:time_per_output_token_seconds, vllm:num_requests_waiting, vllm:num_requests_running and a request counter with a status label; add an environment variable that injects a configurable error rate and TTFT inflation.
  2. 2Write docker-compose.yml running three replicas, Prometheus scraping them every 5 s, Alertmanager and Grafana.
  3. 3Define two SLOs in a README: 99 percent of requests have TTFT under 500 ms over 30 days, and 99.9 percent of requests succeed over 30 days; compute each error budget in minutes.
  4. 4Write recording rules for the good-event ratio of each SLI and alerting rules with two burn-rate pairs (14.4x over 1 h and 6x over 6 h) following the SRE workbook.
  5. 5Build a Grafana dashboard with TTFT p99 per replica, error ratio, burn rate and remaining budget panels.
  6. 6Drive load with a small client; inject a 10 percent error rate on one replica and confirm the fast-burn alert fires; remove it and confirm the alert resolves.
  7. 7Inject TTFT inflation of 400 ms on all replicas and confirm the latency burn alert fires while a 100 ms inflation does not.
Deliverable
The compose stack, rule files, dashboard JSON and screenshots of the alert firing and resolving.
Check
Error budget for the 99.9 percent SLO is computed as 43.2 minutes per 30 days; the fast-burn alert fires within 5 minutes of injecting the 10 percent error rate and resolves after removal; the 100 ms inflation produces no alert.
L2

Chaos drill with graceful degradation behind a router

CPU · your Maccli120 minrequired

Goal · Kill a replica behind a small router under load three times, once with no protection, once with retries and health ejection, once with load shedding added, and measure user-visible failures each time.

  1. 1Write router.py (FastAPI or nginx config) in front of the three stub replicas with least-outstanding routing, a 2 s health check interval and ejection of unhealthy replicas.
  2. 2Run a load generator at 30 concurrent streaming requests for 3 minutes and record total requests, failed requests and TTFT p99 as the baseline.
  3. 3Drill 1: docker kill one replica at minute 1 with retries disabled; record failures and how long the router kept sending traffic to the dead replica.
  4. 4Drill 2: enable one retry on connection error and idempotent re-dispatch for requests that had not streamed a token; repeat and record.
  5. 5Drill 3: add load shedding that returns 429 when num_requests_waiting across live replicas exceeds 20, and a degradation mode that caps max_tokens at 128 when the TTFT p99 over the last minute exceeds the SLO; repeat and record.
  6. 6Plot failures per 10 s bucket for the three drills on one chart and mark the kill time.
  7. 7Record the timeline of every drill in a shared notes file with timestamps; you will use it for the postmortem in l3.
Deliverable
router.py, the load generator, the chart and the timeline notes.
Check
Drill 1 shows a failure burst lasting at least one health-check interval; drill 2 reduces failed requests by at least 80 percent relative to drill 1; drill 3 keeps TTFT p99 of accepted requests under the SLO while the 429 count is nonzero.
L3

On-call runbook and postmortem

CPU · your Macdesign120 minrequired

Goal · A runbook for the two alerts from l1 and a blameless postmortem for drill 1 from l2, both in the format a production team would accept.

  1. 1For each alert write a runbook page with: what the alert means, how to confirm it is real in Grafana, the three most likely causes with a check for each, the mitigation commands (drain, scale, roll back, enable degradation mode), and escalation.
  2. 2Add a section on GPU-specific triage that maps Xid codes and NCCL timeout log lines to actions, citing the NVIDIA Xid reference.
  3. 3Write the postmortem for drill 1 with summary, impact in numbers (failed requests, minutes of SLO burn), a timestamped timeline from your notes, root cause and contributing factors, what went well, what went badly, and action items.
  4. 4Make every action item change code or automation (for example, add health ejection, add retries) rather than documentation, with an owner and a due date.
  5. 5Have one other person review both documents and resolve every comment.
  6. 6Store both documents in your notes repository next to the drill artifacts.
Deliverable
runbook.md and postmortem-drill1.md with reviewer comments resolved.
Check
The runbook covers both alerts with at least three causes and one mitigation command each; the postmortem has a timeline with at least 6 timestamped entries and at least 3 action items that reference code or configuration, not documentation.

Build your own

Build your own chaos drill kit

PythonCPU · your Mac~7 h

A fault injector driven by a drill plan, an SLO and burn-rate checker, a drill runner with a steady-state hypothesis and abort rule, and a generator that turns a drill into a blameless postmortem.

The real thing: github.com/chaos-mesh/chaos-mesh ↗

How you know a stage passes

Write tests/test_drill.py first. The injector is tested against the stub fleet and router from the resilience build running as local processes (or the Docker Compose stack from lesson l1); the SLO checker is tested on synthetic CSV fixtures with known answers; the postmortem generator is snapshot-tested against a fixture report. Run `pytest -q`; the final stage runs all drills with `drill gameday`.

Stages, in order. Each one leaves you with something that runs.0/6
  1. 01the fault injector
    A drill plan YAML schedules faults at offsets, kill (SIGKILL), pause (SIGSTOP then SIGCONT), latency (a proxy adding a fixed delay), errors (a replica flag returning 500 for a percentage) and memory pressure (a cgroup or ulimit cap).
    test · `drill run plan.yaml --dry-run` prints the timeline; a plan with kill replica-1 at 30 s leaves that process gone within 1 s of the offset, and the event log records it with a timestamp.
  2. 02the SLO checker
    From the load generator CSV and Prometheus, compute availability, TTFT p99 and ITL p99 against SLO definitions, error budget consumed and burn rate over 5 m, 1 h and 6 h windows.
    test · A fixture with exactly 0.5 percent failures reports availability 99.5 and a 5x budget burn against a 99.9 SLO; a fixture built to burn at 14.4x triggers the page-level alert and one at 1x does not.
  3. 03the drill runner
    One command starts the load generator, applies the plan, collects metrics and produces a report with fault markers, failed requests, time to detect and time to recover.
    test · The kill-one-of-three drill yields a report whose time-to-recover (first second with error rate back under 0.1 percent) is measured at 1 s resolution and whose failed-request count equals the load generator's.
  4. 04steady-state hypothesis and abort
    Before injecting, the runner requires 60 s with error rate under 0.1 percent; during the drill it aborts and reverts all faults if availability drops below a blast-radius threshold.
    test · A drill that kills all replicas under a 95 percent threshold stops early, SIGCONT and proxy resets are applied, and the log ends with ABORTED and the reason; a drill that fails the steady-state check never injects.
  5. 05the postmortem generator
    From a drill report, emit a blameless postmortem in Markdown with timeline, impact numbers, detection and mitigation times, contributing factors and an action-item table with owners and due dates.
    test · Every heading from the template is present, timeline timestamps match the drill log exactly, and the snapshot test against the fixture passes.
  6. 06game day
    Five drills (kill, straggler pause, network latency, memory pressure, bad deploy returning 500s) run unattended against the protected and the unprotected router configuration and produce a summary table.
    test · `drill gameday` completes all ten runs with one command; the table shows protected availability at or above 99.5 percent and the unprotected figure lower on at least three drills; the README includes the table and one generated postmortem.

Knowledge check

QWhy alert on error-budget burn rate rather than on TTFT p99 crossing a threshold?

Burn rate measures how fast you are consuming the budget over a window, so a short blip that costs little budget does not page you while a sustained problem does; a threshold alert pages on both.

QWhat is the error budget for a 99.9 percent availability SLO over 30 days?

0.1 percent of 30 days, which is 43.2 minutes.

QGive two graceful degradation levers specific to LLM serving.

Capping max_tokens so decode work per request shrinks, and routing to a smaller or quantised model; both keep answers flowing while cutting per-request cost.

QWhat makes a postmortem action item good?

It changes the system (code, configuration, automation) so the failure cannot recur or is detected automatically, and it has an owner and a date.

QA replica vanishes and the node log shows Xid 79. What happened and what do you do?

The GPU fell off the PCIe bus, a hardware fault; drain the node, let the router eject the replica, open a hardware ticket, and check whether automated node remediation caught it.

Completion

  • All 7 subtopics marked done
  • All 3 required lessons done
  • Lesson l1 stack fires and resolves the burn-rate alert as specified.
  • Lesson l2 chart shows the three drills with the expected reduction in failures.
  • Lesson l3 runbook and postmortem reviewed by one other person.
  • Can define SLI, SLO and error budget and derive the budget for any SLO in your head.
Topic progress is derived; it reaches 100% when both checks above pass.Next recommended topic →