LLM Service Outage Post-Mortem: Capacity, Caching, and Degradation Done Right

    A structured breakdown of why generative AI services suddenly slow down, time out, or truncate responses—covering how to classify availability symptoms, reason about token-based capacity instead of QPS, diagnose bottlenecks with minimal signals, apply degradation strategies that protect the core experience, and design for long-term resilience under uncertainty.

    LLM Service Outage Post-Mortem: Capacity, Caching, and Degradation Done Right

    Recent discussions about an AI chat service suffering from “lag, timeouts, and interrupted responses” are, at their core, familiar stability problems for high-concurrency generative inference systems. What users see as “the service is down” should be decomposed by engineers into four distinct signals: is the entry point reachable, are sessions queuing, is time-to-first-token elevated, and are long outputs being truncated? Since real-time status and internal topology of any single platform can’t be confirmed from public channels, the more robust approach is to abstract the incident into a generic failure model: requests briefly exceed effective supply, cache benefits get diluted by a flood of similar long-context traffic, upstream accelerator resources or cross-region elastic capacity fluctuate, and frontend retries plus client-side timeouts amplify the load—ultimately manifesting as queue timeouts, empty replies, and intermittent 5xx errors.

    These problems are rarely caused by a single point of failure. The biggest difference between generative services and ordinary web services is that “per-request cost is not constant”: the same call can vary widely in latency and GPU memory footprint depending on input length, output length, prefix cache hits, tool-call triggering, or safety review routing. Traditional QPS-based capacity estimation therefore breaks down; you must instead track token-level throughput, concurrent session residency, prefix cache hit rate, output length distribution, and cancellation rate.

    1. Define “Crash” First: Availability Symptoms Are Not Process Failures

    User-reported “suspected crashes” typically fall into three categories. The first is connection-layer failure—gateway timeouts, DNS flapping, or mobile retries on weak networks—which makes clients misclassify ordinary slow requests as outages. The second is inference-layer congestion: the API isn’t fully erroring, but first-byte latency rises, streaming output stalls, and generations get canceled mid-way. The third is policy-layer rejection—rate limiting, quota exhaustion, content safety interception, or context-length limits—with unhelpful error messages that users also perceive as “it’s broken.”

    So the first step isn’t arguing about whether it “crashed,” but establishing a severity taxonomy: P0 for full unavailability of the core domain with sustained error-rate breaches; P1 for degradation affecting some models, some entry points, or long-output scenarios; P2 for elevated latency that retries and degradation can still handle; P3 for single-user issues like local network, client version, or permissions. Without this shared vocabulary, operations, support, and engineering will talk past each other and miss the golden window for damage control.

    2. Why Capacity Suddenly Runs Out: From the QPS Illusion to Token Supply

    The effective capacity of generative inference can be roughly understood as: tokens servable per unit time ÷ average token consumption per session. The problem is that the denominator is extremely unstable. When large numbers of users paste long documents, carry multi-turn context, and ask for “detailed analysis,” both input and output balloon. If the service also handles heavy tasks like code generation, table parsing, or web-grounded summarization, average GPU memory residency stretches—and although QPS looks unchanged, queue depth is already out of control.

    More insidious is cache contention. Many systems reuse common prefixes, system prompts, template snippets, or retrieval results to reduce redundant computation. When a trending event drives highly similar requests, the cache briefly benefits; but if user questions are highly individualized with divergent contexts, hit rates drop and the costs previously amortized by the cache rebound quickly. Add automatic client retries after timeouts, manual refreshes, and third-party aggregator polling, and you get a positive feedback loop: the slower it gets, the more people refresh, which makes it slower still.

    The supply side can also wobble. Cross-region elastic compute, upstream accelerator delivery, data center network congestion, and cold starts from image rollouts can all shrink available instances for a period. The answer isn’t to assume any particular vendor will fail, but to treat external supply as a variable you can’t fully control: the core path must be able to protect the core, shed premium features, and throttle the long tail when supply drops.

    3. Diagnostic Order: Use Minimal Signals to Find the Biggest Bottleneck

    Without internal access, external probes give a coarse-grained picture: test across different networks and regions, short vs. long requests, streaming vs. non-streaming, new vs. existing sessions. If short requests succeed while long ones fail, suspect context and memory issues; if the first streamed chunk is slow but the stream is stable afterward, suspect queuing and scheduling; if new sessions fare worse than old ones, suspect session state, auth, or cache consistency; if degradation follows a fixed daily pattern, suspect traffic peaks, batch jobs, or deployment windows.

    With platform access, trace backwards through the chain: gateway error rates and rate-limit hits; load balancer backend health checks; inference queue depth, average wait time, and cancellation reasons; whether the scheduler is skewing across instances; GPU memory fragmentation and KV cache usage; model load and cold-start counts; safety interception and tool-call latencies; and whether logs, tracing, and metrics are missing key fields. In general-purpose cloud environments such as Baidu AI Cloud, you can combine object storage, message queues, container platforms, logging, and monitoring as building blocks—but the critical piece is a unified trace ID that links “user click → gateway → queue → inference → storage → callback” into a single line.

    An illustrative Prometheus-style metric scheme might look like:

    1. llm_queue_depth{pool="chat"}
    2. llm_time_to_first_token_seconds{quantile="0.95"}
    3. llm_tokens_in_total / llm_tokens_out_total
    4. llm_prefix_cache_hit_ratio
    5. llm_request_cancel_total{reason="client_timeout|server_abort|policy"}
    6. llm_gpu_kv_utilization

    What matters isn’t the metric names but the dimensions: model tier, pool, region, entry point, client version, streaming vs. non-streaming, and context-length buckets. Without context buckets, a long-request storm gets hidden inside averages.

    4. Stop the Bleeding: Protect the Core Experience, Sacrifice Non-Critical Features Deliberately

    During a congestion spike, the goal shifts from “everyone gets full service” to “core requests complete.” Common tactics include: shortening max output and context windows, temporarily disabling expensive premium features; converting ultra-long documents into extract-then-summarize-then-follow-up flows; moving non-realtime tasks into async queues with clear wait messaging; weighted queuing by user tier and session value instead of one-size-fits-all throttling; exponential backoff with jitter on retries, with hard client-side caps on resubmission; and prioritizing partial persistence of streaming responses that are mostly generated, allowing resumption or returning partial results marked as truncated.

    Degradation must be productized, not just a backend parameter tweak. For example, when queue depth crosses a threshold, the frontend should display “lightweight mode is active; long-form generation has higher latency” and offer three options: “move to background processing,” “compress context,” or “outline only.” Users tolerate bounded waiting; they don’t tolerate an unexplained spinner. Public status updates should likewise avoid absolute language and stick to verifiable facts: scope of impact, start time, current mitigations, and the next update time.

    5. Long-Term Resilience: Design for Uncertainty, Not for Headroom

    The long-term fix starts with rewriting the capacity model: build it on p95/p99 token consumption, output length distribution, peak concurrency, cache hit rates, and cancellation rates—and load-test with mixed realistic traffic rather than hammering QPS with fixed short prompts. Next is multi-pool isolation: split lightweight chat, long-form, code, and batch workloads into separate pools so long-form tasks can’t starve ordinary Q&A. Then comes elastic boundaries: cross-region scheduling must account for cold-start and data-compliance costs, not just per-instance pricing; a unified scheduling abstraction across self-hosted and managed resources reduces behavioral drift during migration.

    Prompt and context governance is stability engineering too. Version system prompts and cap their length; budget retrieval snippets; prune conversation history by importance; compress tool-call results structurally; and set upper bounds on instructions like “continue” or “go into more detail” that can stretch output indefinitely. Safety policies should be moved upfront to explainable interception rather than terminating generation halfway—wasting compute and hurting the experience.

    Finally, there’s post-mortem culture. Every incident should produce a timeline, trigger conditions, amplifiers, effective actions, sources of false alarms, and unresolved questions—with “rumors, user reports, monitoring curves, and change records” plotted on the same axis. Mark unverifiable external causes as hypotheses, not conclusions; assign owners and deadlines to known architectural debt. A truly mature service isn’t one that never lags—it’s one that, when supply jitter, traffic anomalies, and cache misses hit simultaneously, still tells users what happened, when it will recover, and how to proceed.