LLM Service Outage Post-Mortem: Technical Review and Disaster Recovery Practices

    This article reviews a large-scale LLM service outage and breaks down the request path across the access, session, orchestration, inference, post-processing, and dependency layers to explain why failures surfaced across web, mobile, and API clients at the same time. It covers error code semantics, end-to-end tracing with a trace ID, compute scheduling for long-context workloads, rate limiting, degradation, and circuit breaking, session and task recoverability, the post-incident review process, and client-side practices such as timeout budgets, idempotency keys, and exponential backoff with jitter.

    1. Incident Background: A Typical LLM Service Continuity Failure

    An AI assistant platform experienced a widespread service outage in the afternoon. The symptoms were highly representative: the web app stalled while loading, message sends failed, the mobile app returned sync errors, and developer API calls kept returning error codes. Some user sessions were cut off mid-conversation, and in-progress document parsing and code generation tasks were terminated. Status monitoring showed varying degrees of degradation across the main service, the coding capability module, and the model inference cluster. A small number of accounts could access the service intermittently, but stability was extremely poor.

    From a technical perspective, this was not a single point of failure but a typical case of “simultaneous degradation across multiple dependency levels.” Understanding it requires breaking down the path of a single user request.

    2. Request Path Breakdown: Why the Failure Surfaced Across All Clients

    A typical LLM chat request passes through the following layers:

    1. Access layer: load balancing, authentication, tenant identification, rate limiting;
    2. Session layer: session state storage, context assembly, history message retrieval;
    3. Orchestration layer: intent recognition, tool invocation, retrieval augmentation, prompt template rendering;
    4. Inference layer: model cluster scheduling, batch queuing, GPU memory and compute allocation;
    5. Post-processing layer: streaming output, content safety filtering, token metering and billing;
    6. Dependency layer: object storage, logging service, monitoring and alerting, message queue.

    The root of the “synchronized errors across clients” is that the web app, mobile app, and open API share the same session layer and inference layer. The access channels differ, but the backend is coupled. So once the inference cluster or session storage degrades, every entry point fails at the same time rather than a single client failing alone.

    3. Error Codes and Observability: Turning a Black Box into a Diagnosable System

    During the incident, developers received continuous error responses. Engineering practice calls for layered, semantic error handling rather than a generic failure response:

    1. 401/403 Authentication and permission issues
    2. 429 Rate limit triggered or quota exhausted
    3. 503 Backend temporarily unavailable (retryable)
    4. 504 Upstream timeout (inference queue too long)
    5. 4028-class Custom business errors: mostly quota, tenant status, or risk control blocks

    It is recommended to inject a unified tracking identifier into every request and propagate it across the full path:

    1. def build_context(request, tenant):
    2. return {
    3. "trace_id": request.headers.get("X-Trace-Id"),
    4. "tenant_id": tenant.id,
    5. "channel": request.headers.get("X-Channel"), # web/app/openapi
    6. "model_route": tenant.route,
    7. "quota_snapshot": tenant.quota.used_ratio,
    8. }

    With a trace_id, you can correlate “the user says it is stuck” with “inference queue backlog” or “storage read timeout.” Without observability, fault localization is guesswork.

    4. Compute Scheduling: Where the Pressure Comes From in Long-Context Scenarios

    Long-context processing is a pressure amplifier. The longer the context, the faster attention computation and GPU memory usage grow, and the per-request resource cost is significantly higher than for short conversations. When instantaneous peaks approach the cluster’s capacity limit, the common consequences are rising queue latency, lower batch efficiency, and some requests being actively rejected.

    A sound scheduling strategy should include:

    • Tiered queues: prioritize interactive short requests and route long document parsing to a separate queue so long tasks do not block short ones;
    • Admission control: make admission decisions based on remaining compute; fast rejection is better than letting requests queue indefinitely;
    • Elastic scaling: scale based on multiple metrics such as queue length, queue latency, and GPU memory水位, not CPU alone;
    • Tenant isolation: pool critical tenants separately from anonymous traffic to prevent public resources from being saturated by a sudden spike.

    Illustrative admission control logic:

    1. def admit(req, cluster):
    2. if cluster.queue_wait_ms > 800 and req.is_interactive:
    3. return "reject_fast", 429
    4. if req.context_tokens > 30000 and cluster.gpu_free_ratio < 0.15:
    5. return "degrade", "summary_mode"
    6. return "accept", None

    5. Rate Limiting, Degradation, and Circuit Breaking: Three Gates for Availability

    High availability does not mean “never failing” but “behaving predictably when failures occur.”

    1. Rate limiting: set token buckets across three dimensions—tenant, API, and account—to prevent a single point from overwhelming the whole system;
    2. Degradation: disable non-core capabilities (such as complex tool invocation and deep retrieval) while keeping basic chat; automatically switch long documents to a segmented summary mode;
    3. Circuit breaking: quickly trip the circuit on dependencies that keep timing out, combined with exponential backoff retries, to prevent a retry storm from taking down the backend a second time.
    1. def on_overload(channel):
    2. if channel == "openapi":
    3. return {"mode": "basic_chat", "tools": []}
    4. return {"mode": "chunked_summary", "max_chunk": 8000}

    Paid channels also need isolation and guarantees, but the guarantee comes from resource reservation and priority queues, not from “paying means no limits.”

    6. Session and Task Recoverability: Don’t Let a Mid-Task Disconnect Destroy Work

    What hurts users most is not a brief error but the loss of task progress. Engineering should ensure:

    • Sessions and context are periodically persisted to durable storage to support resume from checkpoint;
    • Long tasks are split into multiple re-entrant stages, with each stage’s results saved independently;
    • When streaming output is interrupted, the frontend retains already-generated content and prompts that a retry can resume;
    • Heavy tasks such as document parsing are made asynchronous through a message queue so they can be replayed on failure.
    1. Task state machine: queued -> running -> (failed | done)
    2. On failed, re-enter from the most recent stage based on the checkpoint rather than restarting the whole task

    7. Post-Incident Review: From “Apology” to “Verifiable Improvement”

    Mature continuity management requires a fixed process: incident severity classification, timeline reconstruction, root cause analysis, closed-loop improvement items, and public status page updates. External communication should cover impact scope, current status, estimated recovery time, and the compensation policy; internally, improvement items should be turned into verifiable engineering tasks, such as lowering scale-out thresholds, shipping queue isolation, and expanding load tests to cover long-context peak scenarios.

    8. Client-Side Recommendations for Developers

    Even when the platform side fluctuates, integrators can significantly reduce losses:

    • End-to-end timeout budget: set separate limits for connection, first byte, and total duration;
    • Idempotency keys: avoid duplicate billing and duplicate writes caused by retries;
    • Exponential backoff with jitter, respecting the semantics of 429 and Retry-After;
    • Multi-model routing and local cache fallback, keeping a degraded answer for critical scenarios;
    • Metering reconciliation: when token statistics are abnormal, defer to the server-side bill and retain logs.

    9. Conclusion

    Competition in LLM services is shifting from the “upper bound of capability” to the “lower bound of continuity.” An elastic compute pool, tenant isolation, tiered rate limiting, recoverable tasks, and solid observability together form the reliability foundation of a commercial service. From the cloud-native infrastructure perspective emphasized by Baidu AI Cloud, the elastic scaling of container platforms, the asynchronous decoupling of message queues, and the full-path tracing of logging services and monitoring/alerting are all key means of compressing a “sudden outage” into “localized degradation.” For consumers, building retries, idempotency, degradation, and checkpoint resume into business code is the most practical preparation for uncertainty.