LLM Service Outage Post-Mortem and Disaster Recovery Engineering

    This article walks through a real multi-end outage of a large language model service and turns it into a practical reliability playbook. It abstracts the failure into three root-cause classes (capacity, state consistency, and shared dependencies), explains why long-context inference is more fragile than typical web workloads, and then covers capacity governance driven by observability metrics, quota consistency patterns, a staged path from single-active to multi-active disaster recovery, and the release and chaos-engineering practices that make reliability repeatable. Enterprise readers will find concrete guidance on fallback models, retry and idempotency design, and bringing quota and monitoring data into their own observability stack.

    1. What a “Multi-End Simultaneous Error” Actually Tells You

    During a recent incident, an AI coding tool returned errors at the same time on the web app, the IDE plugin, and direct API callers. When failures surface across every entry point simultaneously, the root cause is rarely a single endpoint. It is usually a shared dependency being overwhelmed, with the failure cascading outward. Two earlier incidents offer useful reference points: one occurred while a new model version was rolling out, when instantaneous traffic approached the cluster’s capacity ceiling and the platform had to temporarily tighten user access; the other happened during a version iteration, when API rate limiting and token quota accounting both misbehaved, and a public apology was issued.

    Abstracted from these events, the failure sources fall into three categories:

    • Capacity failures: request arrival rate exceeds effective compute, queueing latency amplifies, and the system eventually tips into timeouts and cascading collapse.
    • State failures: strongly consistent data such as counters, quotas, and sessions becomes delayed or inconsistent, producing the “I still have quota but my request was rejected” experience.
    • Dependency failures: shared components such as the gateway, authentication, vector retrieval, and object storage jitter, and every client perceives it at once.

    2. Why Long-Context Workloads Are More Fragile

    The load profile of long-context inference is fundamentally different from short conversations, which means its disaster recovery design cannot simply copy a conventional web service:

    1. GPU memory and batching constraints. The longer the context, the more KV cache each request occupies, the smaller the batch size that can run concurrently, and the lower the effective throughput per device. Scaling out therefore yields non-linear marginal returns.
    2. Both time-to-first-token and total latency are amplified. Long inputs require a full prefill pass first, wait times for queued requests form a long-tail distribution, and timeout retries make congestion worse.
    3. Cost structure is sensitive. Long-context compute carries a high unit price, so over-provisioning redundancy directly erodes gross margin. Elasticity policies have to be precise.
    4. More state is involved. Session history, retrieval caches, and quota counters are all stateful, so recovery cannot rely on simply restarting instances.

    3. Capacity Governance: Turning the Peak into a Computable Problem

    Capacity should not be reserved on intuition; it should be derived from data. Start by establishing a minimal observability loop with four metrics: arrival rate (QPS), the distribution of input and output lengths, compute cost per request, and queueing latency.

    1. # Illustrative: capacity estimation and admission control based on length distribution
    2. import math
    3. def required_slots(qps, p95_input, p95_output, cost_per_1k, safety=1.3):
    4. # Rough estimate using "tokens processed per unit of compute per second" as the baseline
    5. tokens_per_req = (p95_input + p95_output)
    6. load = qps * tokens_per_req / 1000.0 * cost_per_1k
    7. return math.ceil(load * safety)
    8. def admission_control(current_load, capacity, priority):
    9. # Let high-priority traffic (e.g., paid enterprise paths) through first;
    10. # low-priority traffic is queued or degraded
    11. if current_load < capacity * 0.8:
    12. return "accept"
    13. if priority == "high" and current_load < capacity:
    14. return "accept"
    15. return "degrade"

    Three supporting measures matter here. First, tiered quotas: split interactive completion, long-document analysis, and batch jobs into separate resource pools so batch work cannot starve the interactive path. Second, queue isolation with priority scheduling, so retry storms cannot take down everything. Third, an elastic compute pool that combines horizontal scaling on the container platform with pre-warmed instances to shorten the time for new capacity to take effect, plus small-traffic canary rollouts for new model versions.

    4. State Consistency: The Right Fix for Quota Accounting Anomalies

    Quota and entitlement problems are fundamentally about “accurate counting in a distributed environment.” Two patterns are common in practice:

    • Strong consistency path: critical deductions go through a single authoritative store, using conditional updates to guarantee no oversell.
    1. -- Illustrative: conditional deduction to prevent over-issuance under concurrency
    2. UPDATE quota
    3. SET used = used + :delta
    4. WHERE tenant_id = :tid
    5. AND used + :delta <= quota_limit;
    • Eventual consistency path: deduct locally first, then reconcile asynchronously, using a message queue to absorb peaks and scheduled compensation jobs to correct drift. Model “reserve, confirm, rollback” as an explicit state machine; a failed request must roll back, otherwise users see quota vanish into thin air.

    For observability, bind quota events to the request trace ID so any disputed request can be traced to a specific deduction record.

    5. Disaster Recovery Architecture: A Staged Path from Single-Active to Multi-Active

    Disaster recovery does not have to be built in one step. Advance it in tiers according to business continuity requirements:

    1. Multi-availability-zone within the same city: covers data-center-level power loss and network isolation at manageable cost, and is the right first step.
    2. Remote disaster recovery: asynchronous data replication with explicit RPO and RTO, validated through real failover drills rather than paper plans.
    3. Multi-active with traffic scheduling: route traffic by health checks and geo-proximity, shrinking the blast radius to a single availability zone.

    This needs a graceful degradation checklist: disable non-essential context augmentation, cap the maximum output length, switch to a smaller parameter model, or return cached results and templated suggestions. Degradation must be perceivable and explainable to users, not a raw error.

    6. Release and Drills: Making Reliability a Process

    • Canary release with automatic rollback, gated on error rate, queueing latency, and time-to-first-token.
    • Chaos engineering: regularly inject latency, packet loss, and dependency unavailability to verify that degradation and rate limiting behave as designed.
    • Routine capacity load testing: replay traffic using real length distributions instead of uniform short requests.
    • Post-mortem discipline: after an incident, produce a timeline, root cause, action items, and owners, and close the loop.

    7. Practical Guidance for Enterprise Teams

    Enterprises should not place continuity entirely in the hands of a service provider. Three things are worth doing. First, keep an abstraction layer over backup models and backup vendors for critical paths, avoiding lock-in to a single implementation. Second, implement exponential backoff with jitter on the client, and set per-request timeouts and idempotency keys to prevent duplicate billing. Third, feed quota, log, and monitoring data into your own observability stack so you can form an independent judgment. The approach Baidu AI Cloud takes across general capabilities such as container platforms, log services, and monitoring and alerting can serve as a reference model for building this kind of continuity foundation.

    8. Closing Thoughts

    Competition in LLM service reliability is shifting from “model capability” to “engineering determinism.” Once peak capacity is calculated rather than guessed, state consistency is made solid, and degradation and drills become routine, incidents like multi-end simultaneous errors stop being uncontrollable events and become ordinary operational scenarios that are predictable, recoverable, and reviewable.