Why LLM Services Crash Under High Concurrency: Causes and Resilience Design
This article breaks down why large language model services often fail during traffic spikes after a launch, using a typical "release triggers a peak" incident as an example. It explains the root causes through queueing behavior, batching trade-offs, long-context resource amplification, coupling between stateful and compute workloads, and retry storms. It then covers capacity planning with verifiable assumptions, elastic scaling, layered rate limiting and degradation, canary releases, observability, and a pre-release checklist to turn sudden outages into known and controllable engineering variables.
1. Abstracting the Incident: A Typical “Release Meets Traffic Peak” Failure
After a new model went live in an AI coding tool, the service became briefly unavailable. It started with a short crash, then both the web app and API calls went down at the same time. Instability returned in the evening. According to the official status page timeline, chat capability recovered first, while account-related capabilities were still abnormal; login and registration were affected, and the team then entered an ongoing observation phase. The official response attributed the issue to localized service fluctuations, a surge in traffic that exceeded concurrency capacity, and maintenance and request-limiting policies, and said an investigation was underway.
Setting the specific product aside, this timeline is very common in the industry. It can be abstracted into a failure chain: release → peak → overload → cascade → partial recovery. Its value is that it exposes a counterintuitive fact: most large-scale failures do not come from code defects, but from the gap between capacity assumptions and the real traffic distribution.
2. Root Cause Breakdown: Why a Traffic Surge Becomes a Full Outage
2.1 The Queueing Nature of Inference Resources
The biggest difference between LLM inference and regular web requests is that a single request occupies resources for a long time and with high variance. If you treat a request as the service time in a queueing system, then as the arrival rate approaches the service rate, queue length and waiting latency rise nonlinearly. This means the system may already have crossed the latency inflection point even at load levels that “still look like they have headroom.”
2.2 Coupling Between GPU Memory and Batch Scheduling
Inference services usually rely on dynamic batching to improve throughput, but larger batches mean higher per-batch latency, while smaller batches mean lower throughput. When traffic spikes, the scheduler oscillates between “waiting to accumulate a batch” and “executing immediately,” which easily produces a lose-lose situation where throughput drops and latency rises at the same time.
2.3 Resource Amplification from Long Contexts
As context length grows, it amplifies both GPU memory usage and computation, and this amplification is not linear. A small number of very long requests can occupy a large number of concurrency slots, creating a resource hotspot where “a few requests drag down the whole system.”
2.4 Coupling Between Stateful and Stateless Capabilities
Accounts, authentication, and quotas are strongly consistent stateful capabilities, while chat inference is a horizontally scalable compute capability. When both share the same entry point and the same set of rate-limiting thresholds, overload on the compute side can take down the stateful side as well. This is the structural reason why “chat recovered but login was still abnormal.”
2.5 Retry Storms and Client-Side Amplification
Client timeout retries, gateway retries, and default SDK retries stack up in three layers, amplifying a real traffic peak several times over. Retries without backoff and jitter are essentially a second impact on an already overloaded system.
3. Capacity Planning: Turning Estimates into Verifiable Numbers
The goal of capacity planning is not to produce a nice-looking number, but to produce assumptions that can be falsified by load testing. At a minimum, you should define four categories of metrics: the maximum concurrency of a single instance at the target latency, the average and tail resource consumption per request, the sync/async ratio of dependent components, and the maximum acceptable queueing time.
Illustrative capacity calculation logic (pseudocode, expressing the idea only):
required_instances = ceil(peak_qps * avg_service_time / target_concurrency_per_instance) * safety_factor# safety_factor should cover: burst ratio, AZ redundancy, single-instance failure redundancysafety_factor = burst_ratio * az_redundancy * node_failure_redundancy
The key is that safety_factor must be written explicitly and reviewed, rather than hidden inside a “rule of thumb.”
4. Elastic Scaling: When Scaling Up Cannot Keep Up with the Peak
The failure of elastic scaling is usually not a wrong policy, but a mismatch in time scales. The scaling decision cycle, image pulling, model weight loading, warmup, and readiness probe passing add up to a total time that often far exceeds the traffic ramp-up time. Practical mitigations include:
- Warm pools: keep a certain proportion of ready instances to absorb the first wave of traffic;
- Weight localization and tiered caching: shorten the loading path for cold starts;
- Tiered readiness probes: distinguish three states — “process alive,” “model loaded,” and “ready to serve inference” — to avoid taking traffic too early;
- Predictive scaling: scale up in advance using release cadence and historical periodic peaks as inputs, instead of purely reactive response.
5. Rate Limiting and Degradation: Containing Overload Locally
Rate limiting must be layered, with different responsibilities at each layer: the entry layer does coarse-grained total-volume protection, the gateway layer enforces per-tenant and per-API quotas, and the service layer controls concurrency slots and queue upper bounds. The core principle is “better to reject some requests than to let all requests slow down together.”
if active_slots >= max_slots:return OVERLOADED # fail fast to avoid a queueing avalancheif ctx_length > threshold:route_to_smaller_model_or_reject()
Degradation strategies should be defined in advance and drilled: disable non-core logging and metrics writes, reduce the maximum output length, switch to a smaller model with fewer parameters, and convert synchronous paths into asynchronous tasks that return a task ID for the client to poll.
6. Release Strategy: Keeping a New Model Launch from Becoming the Source of Failure
A new model launch should be treated as a high-risk change and rolled out gradually rather than all at once: ramp traffic by percentage, set clear observation windows and automatic rollback thresholds (such as error rate, time to first token, and overall latency percentiles). Also ensure the old and new versions can run in parallel and be switched back quickly, so that an “irreversible release” does not turn a controllable fluctuation into a long outage.
7. Observability: The Time Budget for Incident Localization
You need to cover four types of signals at the same time: metrics (latency percentiles, queue length, concurrency slot usage), logs (structured and carrying request identifiers), tracing (from the entry point through to inference instances), and client-side success rate. Without request identifiers carried end to end, you cannot distinguish “client retries” from “genuinely new traffic,” which is the most common blind spot in post-incident reviews.
8. General Implementation Guidance for Baidu AI Cloud
If you adopt a cloud-based approach, you can implement the above capabilities with a combination of general product categories: a container platform to host inference instances and elastic scaling, a load balancer for entry-layer rate limiting and traffic splitting, a message queue to absorb asynchronous tasks and smooth peaks, object storage for model weights and version artifacts, logging services and monitoring alerts as the observability foundation, and key and configuration management to keep changes safe. The capability forms Baidu AI Cloud offers in these general categories can serve as a reference for architecture selection, but specific metrics should be based on actual load-testing conclusions.
9. Post-Incident Review Checklist
- Have the capacity assumptions been falsified by load testing;
- Do retries have backoff and jitter, and is there a retry budget;
- Are stateful and compute capabilities isolated in terms of entry points and thresholds;
- Is there fast failure and predefined degradation;
- Have canary and rollback actually been executed in drills;
- Are request identifiers carried through the entire chain.
Turning this checklist into mandatory pre-release checks will reduce a short crash from an “unexpected incident” to a “known and controllable engineering variable.”
