LLM Service Outage Post-Mortem: Capacity Planning and Architecture Resilience for Inference Platforms

    This article analyzes a multi-stage outage of a large model service and turns it into an engineering playbook. It explains why inference workloads behave differently from stateless web services, breaks down the failure chain behind a full outage, and shows why recovery happens in phases. It then covers capacity estimation for KV cache and concurrency, layered traffic governance with rate limiting, priority queues, retry budgets and graceful degradation, safer model release strategies, observability and status transparency, and a practical checklist for developers. The goal is to help teams keep LLM services available when traffic spikes.

    1. Incident Overview: A Typical LLM Service Overload

    An AI model platform experienced a brief service crash on January 26, 2025. The web app and APIs were fully unavailable the next day, followed by another interruption in the evening. Chat capability recovered first at 20:55, while login and registration were still failing. At 21:05, the operator said monitoring was ongoing. The stated causes were two-fold: a surge in traffic after a new model launch that exceeded server capacity, and possible service maintenance together with request throttling.

    Once the brand and product are set aside, this is a recurring industry-wide problem: inference services are stateful workloads with long-lived connections, long execution times, and limited GPU memory, so their capacity model is fundamentally different from traditional stateless web services. Scaling a web service is roughly linear—add machines, gain throughput. LLM inference is constrained jointly by GPU memory capacity, batching efficiency, context length, and decode steps, so scaling has a clear non-linear knee. When traffic multiplies within a very short window, the system goes through a positive feedback loop: queues grow, timeouts increase, retries amplify, connection pools are exhausted, health checks fail, instances are removed from rotation, and the remaining instances take even more load—ending in a “full outage.”

    2. Breaking Down the Failure Chain: Why Recovery Is Phased

    To understand why chat recovered before accounts, split the platform into coupled subsystems:

    • Edge/access layer: load balancing, connection management, rate limiting and auth entry points;
    • Inference layer: model loading, GPU memory allocation, batch scheduling and decoding;
    • Session and state layer: context storage and session consistency;
    • Account and identity layer: login, registration and credential verification, typically backed by a relational database and cache;
    • Dependency layer: message queues, object storage, logging and monitoring.

    The inference layer is usually stateless and can be brought up quickly, so it recovers first. The account layer often involves exhausted database connection pools, cache stampedes, transaction lock waits, and congestion in external verification channels such as email or SMS. It needs the backlog to drain and connections to be rebuilt, so it lags behind. The lesson for architecture design is that recovery is ordered, and recovery priorities should be defined in advance.

    3. Capacity Planning: Translating Concurrency into a Resource Ledger

    Capacity evaluation should not look at QPS alone. It should be converted into “concurrent decoding requests × average output length × context length.” An illustrative estimation logic:

    1. # Illustrative capacity estimation only; not parameters of any specific product
    2. def estimate_kv_cache_gb(concurrency, ctx_len, layers, kv_heads, head_dim, bytes_per_val=2):
    3. # KV Cache is roughly 2 (K/V) * layers * kv_heads * head_dim * sequence length * concurrency * bytes
    4. per_req = 2 * layers * kv_heads * head_dim * ctx_len * bytes_per_val
    5. return concurrency * per_req / (1024 ** 3)
    6. need = estimate_kv_cache_gb(concurrency=200, ctx_len=4096,
    7. layers=32, kv_heads=8, head_dim=128)
    8. print(f"KV cache alone needs about {need:.1f} GB of GPU memory")

    This yields three hard conclusions: context length and concurrency are multiplicative; output length determines how long resources are held; GPU memory is a hard ceiling, and exceeding it triggers queuing or rejection. The sensible approach is admission control—reject fast when the system water level crosses a threshold instead of queuing indefinitely.

    4. Traffic Governance: Rate Limiting, Queuing and Graceful Degradation

    Launching a new model naturally creates a traffic spike, so governance should be layered:

    1. Ingress rate limiting: token buckets per user, tenant and endpoint to protect the backend;
    2. Priority queues: paid and business-critical traffic first; low-priority requests can be delayed or rejected;
    3. Timeouts and retry budgets: allocate a retry budget per request to avoid retry storms;
    4. Degradation strategies: cap maximum output length, shrink the context window, switch to a smaller model, disable non-core web access and plugin capabilities;
    5. Static fallback: in extreme cases, serve cached results or a clear service announcement page.

    Illustrative middleware pseudocode:

    1. class TokenBucket:
    2. def __init__(self, rate, capacity):
    3. self.rate, self.capacity = rate, capacity
    4. self.tokens, self.last = capacity, now()
    5. def allow(self, cost=1):
    6. global tokens
    7. refill()
    8. if self.tokens >= cost:
    9. self.tokens -= cost
    10. return True
    11. return False

    The key principle: rate limiting is protection, not denial of service. It must come with clear error semantics (retryable, estimated recovery time), otherwise clients will amplify retries on their own.

    5. Release Strategy: Keeping New Model Launches from Becoming Incidents

    New model releases should follow canary and rollback principles: validate quality and latency on a small traffic share, then ramp up gradually. Roll out inference instances in batches to avoid simultaneous cold starts that contend for GPU memory and bandwidth. Distribute model weights through object storage and pre-load them to warm up. Keep the previous version as hot standby so you can switch back in minutes if something goes wrong. Schedule releases away from business peaks and couple them with capacity expansion—scale out first, then increase traffic.

    6. Observability and Status Transparency: Making Uncertainty Predictable

    The practice of posting continuous updates and marking recovery progress per module is worth institutionalizing. Observability should cover at least request volume, queue time, time to first token, end-to-end latency, GPU memory and batch utilization, error code distribution, and dependency health. Externally, maintain an independent service status page that marks each subsystem as available, degraded, or unavailable, so users do not read a partial failure as a total one. The status page itself must be hosted neutrally, in a separate availability zone and on a separate domain, so it does not share fate with the main service.

    7. Post-Mortem Practice: From Reactive Handling to Proactive Defense

    A post-mortem should produce executable items, not conclusions: explicit trigger thresholds, scaling time baselines, rate limit parameters, a degradation switch inventory with owners. Use fault injection drills to verify that rate limiting and degradation actually work. Maintain a weekly capacity water-level report and include peak forecasts in release reviews. In its architecture practice, Baidu AI Cloud typically recommends combining monitoring and alerting, logging services, container platform autoscaling, and message queue peak-shaving to form a closed loop of “observe—decide—act.”

    8. A Practical Checklist for Developers

    • Model capacity for inference services separately; do not reuse scaling assumptions from ordinary web services;
    • Enable the default trio: ingress rate limiting, priority queues, and retry budgets;
    • Define at least three degradation paths and drill them regularly;
    • Make canary release and hot-standby rollback a release gate;
    • Be transparent externally, reporting at subsystem granularity;
    • Make post-mortems output quantified thresholds and automated actions, not prose.

    LLM service stability is not built by stacking peak hardware. It rests on four engineering capabilities: computable capacity, controllable traffic, degradable failures, and transparent status. Treat this multi-round interruption as a public architecture stress test, close the gaps above one by one, and the service will stay continuous when the next traffic spike arrives.