LLM Service Outage Post-Mortem: Resilience and Disaster Recovery Practices

    This article reviews a typical large language model (LLM) service continuity incident and translates the lessons into practical engineering guidance. It covers failure semantics for custom status codes such as 4028, client-side retry with exponential backoff and jitter, root causes that turn compute pressure into a global outage, elastic compute pool design and capacity governance, a four-layer disaster recovery approach, observability and status transparency, and a developer integration checklist for building resilient AI-powered applications.

    1. Incident Overview: A Typical LLM Service Continuity Failure

    An AI assistant platform experienced a widespread outage in the afternoon. Users saw stalled page loads and failed message delivery on the web client, while the mobile app and the developer API were affected at the same time. From a technical perspective, this was not a single point of failure. It was an architectural characteristic — multiple clients sharing the same backend dependencies — exposed all at once under load.

    The incident showed three common patterns:

    • Surface-wide spread: The web client, mobile client, and open API shared the same inference and authentication path, so one bottleneck made the entire chain unavailable.
    • Broken session state: Long-running tasks such as long-document parsing and code generation were terminated midway, and the context and intermediate results already produced could not be resumed.
    • Lagging observability signals: Users noticed the problem first, and the status page and alerts reflected it only afterward, which suggests the probe granularity and alert thresholds were set too conservatively.

    The key takeaway for developers: when integrating LLM capabilities, treat “the other side is unavailable” as the normal case, not an exception.

    2. Error Codes and Failure Semantics: Why Codes Like 4028 Deserve Their Own Design

    Custom non-standard status codes returned by the platform (such as 4028 and similar codes) usually carry semantics like rate limiting, exhausted quota, or tenant-level circuit breaking. The problem is that most clients handle them as ordinary network errors and trigger retries with no backoff, which makes the avalanche worse.

    Recommended error classification and handling:

    Error category Typical semantics Client action
    Retryable Timeout, transient overload Exponential backoff with jitter, capped attempts
    Non-retryable Invalid parameters, authentication failure Fail immediately and inform the user
    Quota-related Rate limiting, abnormal token quota Queue, or degrade to a smaller model
    Dependency-related Upstream model cluster failure Switch to a backup path

    Illustrative retry implementation:

    1. import random, time
    2. def call_with_backoff(fn, max_retry=3, base=0.5):
    3. for i in range(max_retry):
    4. try:
    5. return fn()
    6. except RateLimited as e: # quota / rate limiting
    7. time.sleep(base * (2 ** i) + random.random() * 0.2)
    8. except UpstreamUnavailable: # dependency failure: fail fast and switch
    9. raise
    10. raise ServiceDegraded()

    The point is to apply backoff only to retryable errors, and the backoff must include random jitter so that large numbers of clients do not wake up in sync and create a second shock.

    3. Root Cause Categories: Why Compute Scheduling Pressure Escalates into a Global Failure

    Historical records show that such disruptions are usually tied to instantaneous peaks approaching the cluster’s capacity ceiling. Typical triggers include:

    1. Static capacity planning: Reserving resources by average load rather than a peak percentile (such as P99), so a traffic spike breaks straight through.
    2. Inference resource fragmentation: Long-context requests hold GPU memory and concurrency slots for a long time, and short requests get blocked at the head of the queue.
    3. No priority isolation: Paid and free tiers share the same resource pool, so paying users are degraded too.
    4. Coupled state services: Session context storage is deployed in the same domain as the inference service, so the failure domain is not isolated.

    The improvement direction is to split “resources” into three schedulable, isolable, reclaimable classes: a reserved baseline pool, an elastic burst pool, and an offline degraded pool, combined with queue priorities and request tiering.

    4. Elastic Compute Pools and Capacity Governance

    The core of an elastic compute pool is not “can it scale out” but “can scaling keep up with the traffic ramp.” Engineering concerns include:

    • Scale-out latency budget: From metric trigger to instance readiness should stay within minutes; for slow cold starts, keep pre-warmed reserved replicas.
    • Metric selection: Combine concurrency, queue wait time, time to first token, and GPU memory utilization. Looking at QPS alone is easy to misjudge.
    • Scale-in protection: Set cooldown windows and a minimum replica count to prevent flapping from causing repeated scale-out and scale-in.
    • Continuous load testing: Replay real long-text requests with shadow traffic to validate peak capacity and degradation thresholds.

    Capacity governance also needs a three-tier “quota — rate limit — queue” mechanism: tenant-level quotas prevent single-point abuse, API-level rate limiting protects the backend, and queue buffering smooths out spikes.

    5. Disaster Recovery: Multi-AZ, Degradation, and Failure Drills

    For enterprise-grade continuity goals, build four layers of capability:

    1. Multi-AZ deployment: Make the inference service stateless and move session state to separate storage to converge the failure domain.
    2. Path degradation: When the primary model is unavailable, switch to a backup smaller-parameter model to keep the service “available but reduced in capability” rather than fully down.
    3. Resumable tasks: Use segmented submission and persistence of intermediate results for long tasks, so an interrupted task can resume from the unfinished segment.
    4. Chaos drills: Regularly inject latency, packet loss, and dependency unavailability to verify that alerts and failover actually work.

    The client side needs resilience too: cache recent results locally, use idempotency keys for requests, and keep an offline queue that automatically replays once the network recovers.

    6. Observability and Status Transparency

    During an incident, “no official explanation and unknown recovery time” amplifies user anxiety. Technically, you should:

    • Cover the end-to-end path with probes, separating client network, authentication, queueing, and inference into four timing segments;
    • Automate the status page, driven directly by monitoring alerts rather than manual confirmation;
    • Publish incident severity levels and an estimated recovery window to reduce the extra load caused by repeated inquiries.

    7. Developer Integration Checklist

    • Set timeouts, capped retries with backoff, and circuit-breaker thresholds for every call;
    • Distinguish error semantics, and route quota-related errors into a queue instead of a retry storm;
    • Segment long-text and code tasks and persist checkpoints;
    • Prepare a backup model path and local fallback results for critical business flows;
    • Add time to first token and failure rate to your own SLO dashboard.

    8. Conclusion

    LLM services have moved from “usable” to “must stay continuously available.” For providers, elastic compute pools, failure domain isolation, and transparent status disclosure are the foundation for commercialization. For consumers, treating instability on the other side as the default premise and protecting yourself with three tools — backoff, degradation, and resumable execution — is the reliable path to embedding AI capabilities into production systems.