Why Large Language Model Services Lag and Crash: Capacity, Memory, and Scheduling Explained
This article explains why large language model (LLM) services slow down or become unavailable, breaking the problem down into four supply-and-demand bottlenecks: rigid compute supply, GPU memory limits on concurrency, cache amplification from long contexts, and traffic spikes combined with weak scheduling. It then outlines stability practices, including capacity planning and load testing baselines, elastic scaling and compute pooling, cache and context governance, request prioritization with graceful degradation, and observability with chaos drills, plus practical advice for users and enterprise teams.
1. Symptoms: From Occasional Slowdowns to Full Outages
Many users have recently reported clear anomalies in a class of large language model services: no first token returned for a long time, requests stuck in a queue, a “service busy” message after refreshing the page, and even complete inaccessibility for short periods. These issues are rarely a single point of failure. More often, they are the external result of a supply-and-demand imbalance between capacity and traffic stacking up across multiple stages.
It is important to distinguish “lag” from “crash” in engineering terms. Lag means rising queue latency while the system is still working; a crash means failed health checks, instances being removed from rotation, or full rate limiting. The two often evolve in sequence, so troubleshooting must cover the entry layer, scheduling layer, inference layer, and dependency layer at the same time.
2. Root Causes: Supply-and-Demand Conflicts at Four Layers
2.1 Rigid Constraints on Compute Supply
LLM inference is a compute-intensive workload, and accelerator supply goes through periodic shortages. Compute resources outside mainland China are also affected by supply chain fluctuations. When new compute delivery is delayed while the user base keeps growing, available compute becomes a hard bottleneck.
2.2 GPU Memory Sets the Concurrency Ceiling
The GPU memory used by a single request can be approximated as:
GPU memory ≈ model weights + KV Cache (grows linearly with context length and concurrency) + runtime overhead
The larger the context window and the higher the concurrency, the more extreme the cache footprint. This also explains why the combination of “long context + high concurrency” is the most likely to trigger an avalanche.
2.3 Cache Amplification
Long-context applications repeatedly feed large amounts of historical content into inference. When the cache hit rate drops, repeated computation grows several times over, and effective throughput per GPU falls sharply.
2.4 Traffic Peaks and Scheduling Strategy
Burst traffic, retry storms, and the absence of queuing and prioritization mechanisms can fill already-stretched resources with low-efficiency requests, creating a feedback loop that keeps making things worse.
3. Building Stability
3.1 Capacity Planning and Load-Testing Baselines
Establish baselines around two core metrics, “time to first token” and “concurrency per GPU,” and reserve headroom of 1.5 to 2 times the peak:
required_replicas = ceil(peak_qps / qps_per_replica * 1.8)
3.2 Elastic Scaling and Compute Pooling
Run inference instances on a container platform, and trigger automatic scaling based on monitoring and alerting metrics such as queue length, GPU memory utilization, and P95 latency. At the same time, build compute pools across multiple availability zones so that a failure in a single resource domain does not make the whole service unavailable.
3.3 Cache and Context Governance
- Reuse a common prefix for system prompts and knowledge snippets to improve cache hit rates;
- Summarize and compress very long histories, and trim them with a sliding window;
- Introduce semantic caching to return results directly for high-frequency similar questions.
3.4 Request Tiering and Graceful Degradation
Priority P0: paid / business-critical → dedicated resource poolPriority P1: general interaction → shared pool + queuePriority P2: batch jobs → run during off-peak hours
Under overload, disable non-core capabilities one by one, shorten the maximum context, and switch to a smaller-parameter model, so the service stays “slow but available.”
3.5 Observability and Failure Drills
Collect trace data through a unified logging service and set multi-level alert thresholds. Run chaos drills on a regular basis, such as rate limiting, network disconnection, and bulk instance restarts, to verify that the fallback logic actually works.
4. Advice for Users
When a service fluctuates, first reduce the context length per request, avoid repeated submissions, and stay away from peak hours. On the enterprise side, treat the LLM as a dependency with capacity limits: build retry backoff, result caching, and alternative options into the architecture instead of assuming it is always available.
5. Conclusion
The stability of LLM services is essentially coordinated engineering across compute, GPU memory, cache, and scheduling. Only by calculating capacity clearly, using the cache cleanly, and designing degradation well can you maintain predictable service quality as demand keeps growing. This is also the direction of stability engineering that cloud providers such as Baidu AI Cloud continue to emphasize within their general cloud product portfolio.
