LLM Serving Under High Concurrency: Why It Crashes and How to Keep It Stable
This article explains why large language model (LLM) serving systems fail under high concurrency and what engineering teams can do about it. It breaks down the common failure pattern in which a sudden demand spike, insufficient elastic capacity, and amplified client retries combine into an overload avalanche. It also covers the real capacity constraints of inference layers, latency collapse near saturation from a queueing perspective, retry storms, unit-task cost economics on aggregation platforms, and practical governance measures across the gateway, elasticity and degradation, caching and batching, observability, and cost attribution.
1. Background: Reading a High-Concurrency Outage
A large-scale LLM online service recently became broadly unavailable again on a specific date. From an engineering standpoint, incidents like this are rarely a single hardware failure. They are usually the combined result of three factors: a sudden spike in demand, insufficient elastic capacity, and amplified client retries. When the instantaneous request rate exceeds the effective throughput of the inference cluster, requests pile up at the gateway and scheduling layers, queueing latency rises, clients time out and retry, and the extra load pushes the system further. The result is a positive-feedback overload avalanche.
It is important to note that LLM inference is fundamentally different from a conventional stateless web service. A single request occupies resources for a long time, GPU memory and compute are tightly coupled, and the batching window is sensitive to latency. Applying the traditional intuition that “adding machines scales capacity linearly” to inference services tends to underestimate how complex the bottlenecks really are.
2. Why “Easy to Use” Turns Into “Unavailable”
One key phenomenon in the original discussion is that when interactive AI coding tools sharply lower the barrier to entry, non-specialist users can complete complex tasks in natural language, and overall platform call volume grows by an order of magnitude. This has two direct consequences.
First, the user mix changes. Traditional API callers are mostly engineers who already practice rate limiting, backoff retries, and cache reuse. New users tend to favor “click and go” usage and lack client-side self-protection, so they retry repeatedly during an outage.
Second, the cost per task differs significantly. The same coding-assistance task often takes only one or a few structured calls through a mature AI coding tool, while working through a general chat interface step by step may require many round trips, multiplying both token consumption and request count. Cost sensitivity pushes users toward the entry point with better perceived value, which further concentrates load on the most popular entry.
3. Capacity and Stability: Breaking Down the Bottlenecks
3.1 The Real Capacity Limits of the Inference Layer
Effective inference throughput is constrained by several factors: GPU memory determines how many sequences can run concurrently, context length and generation length determine the resources a single request occupies, and the batching strategy determines the balance between GPU utilization and latency. When the share of long-context requests rises, resource usage can double even if the request count stays the same.
3.2 Latency Collapse Through a Queueing Lens
Queueing systems have a frequently overlooked property: as utilization approaches 1, waiting time diverges nonlinearly. A system that looks comfortable at 70% load may already be near its timeout threshold at 90% load. Capacity planning must leave enough headroom rather than being designed for peak saturation.
3.3 Retry Storms and Traffic Amplification
If the client default timeout is too short, retries fire before the server has responded, creating a “1 user request → N backend requests” amplification effect. Exponential backoff without jitter also causes retry traffic to resonate in sync along the time axis.
Illustrative client backoff logic:
import random, timedef call_with_backoff(fn, max_attempts=3, base=0.5):for attempt in range(max_attempts):try:return fn()except TimeoutError:if attempt == max_attempts - 1:raise# Exponential backoff with random jitter to avoid synchronized retry resonancesleep = base * (2 ** attempt) + random.uniform(0, 0.3)time.sleep(sleep)
4. Cost Structure: Credits, Platform Cuts, and Unit-Task Economics
Complaints in the original discussion about credit-based billing and platform commission are, at their core, a unit-task cost problem. On most aggregation platforms, cost has three components: the underlying model call cost, platform operations and routing cost, and channel revenue share. When the channel share is too high, the price users perceive is well above the model’s original pricing, pushing them toward more direct calling methods or better-value coding tools.
When evaluating options, organizations should establish a consistent unit of measurement, such as the total cost of completing one standard coding task, rather than comparing per-unit prices alone. Only with a consistent measure can they judge the real payoff of optimizations such as building a self-hosted gateway, reusing caches, or merging batches.
5. Practical Stability and Cost Governance
5.1 Access Layer: Unified Gateway Governance
Introduce a unified access gateway between business services and models to centralize authentication, quotas, rate limiting, circuit breaking, and canary releases. The gateway can apply token buckets per tenant and per API so that a single large customer cannot consume all available capacity.
# Illustrative per-tenant rate limiting and circuit breaker configurationrate_limit:per_tenant_qps: 20burst: 40circuit_breaker:error_rate_threshold: 0.5open_duration_seconds: 30
5.2 Elasticity and Degradation
Inference capacity elasticity has cold-start costs, so combine predictive scaling with reactive scaling. Degradation policies must be defined in advance: protect the core path first, and let non-core requests such as polishing and summarization queue or return cached results.
5.3 Caching and Batching
Build semantic caches and result caches for high-frequency, low-volatility requests, and use micro-batching to improve throughput for requests that can be merged. Cache keys should include the model version and key parameters to avoid returning stale results after a version upgrade.
5.4 Observability
Establish a metrics dashboard centered on time to first token, end-to-end latency, queueing time, failure rate, and token consumption, backed by logging and alerting for fast root-cause identification. The absence of a queueing-time metric is the root cause of why many teams cannot explain why requests still time out after scaling up.
5.5 Cost Governance
Build cost attribution by business line and by task; set budget guardrails for long contexts and very long generations; and include cache hit rate in cost reviews. If an organization already uses relevant Baidu AI Cloud capabilities, it can combine common categories such as object storage, message queues, container platforms, logging, and monitoring and alerting to build a complete peak-shaving and observability system.
6. Conclusion
The availability of LLM services is the combined result of capacity design, traffic governance, and cost structure. For developers, rather than chasing the availability of a single entry point, it is better to build self-protection on both the client and gateway sides. For organizations, a consistent unit of measurement, a unified gateway, and an observability system are the long-term answer that balances stability and economics.
