Why LLM Services Frequently Return "Server Busy" Errors
This article explains why large language model services often return "server busy" messages, framing them as capacity signals rather than random failures. It breaks down the root causes of inference overload, including memory constraints, nonlinear context-length growth, deployment-time capacity dips, and client retry amplification. It then covers application-side and architecture-side optimizations, observability metrics, and a step-by-step troubleshooting checklist.
1. Symptom Analysis: It Is Not “Broken,” It Is a Capacity Signal
A “server busy” message is essentially a server-side overload protection signal. When the inference request volume within a given time window exceeds the throughput limit that the available compute and GPU memory can handle, the scheduling layer actively rejects or queues part of the requests to prevent all requests from degrading together. This distinction matters: it is not a random failure, but a measurable, predictable capacity problem that can be mitigated through architectural means.
Three similar-looking behaviors with different root causes should be distinguished:
- Slower queuing: requests are accepted, but time to first token rises significantly, usually due to a backlog in the batching queue.
- Direct rejection: a busy-type error code is returned, indicating that ingress rate limiting is active or there are too few healthy backend instances.
- Intermittent failures: highly correlated with time windows involving deployments, scaling events, or dependency jitter.
2. Root Cause Breakdown: Why LLM Inference Is More Prone to Overload Than Traditional APIs
1. The Special Nature of Inference Resources
The load of a traditional web API is mainly consumed by CPU and bandwidth, and scaling is relatively linear. LLM inference, by contrast, is constrained by three factors at once: GPU memory capacity, GPU memory bandwidth, and compute unit utilization. GPU memory must hold not only the model weights but also the context cache reserved for each concurrent session, so “how many users can be served simultaneously” is often determined by memory rather than compute first.
2. Context Length Is a Nonlinear Amplifier
When request length doubles, the required cache space and attention computation grow far faster than linearly. A small number of requests with very long contexts can consume a large amount of resources and cause other requests to be queued. Illustrative pseudocode:
# Illustrative only: batch scheduling must account for both length and concurrency limitsdef can_admit(batch, max_tokens, max_slots):used = sum(req.context_len + req.max_output for req in batch)return used <= max_tokens and len(batch) < max_slots
3. Capacity Fluctuations During Releases and Updates
During model version updates, weight loading, and rolling instance restarts, the number of available instances temporarily drops. Combined with users’ habitual retries, this creates a positive feedback loop: the busier it gets, the more users retry, and the more they retry, the busier it gets.
4. Client-Side Amplification
A default timeout that is too short, immediate retries on failure, and the absence of a backoff strategy can amplify a momentary jitter into sustained pressure.
3. Application-Side Optimization: Converging the Uncertainty
- Peak shifting and load smoothing: move batch jobs, offline summarization, and data cleaning tasks to off-peak hours; introduce a message queue at the ingress layer as a buffer.
- Request slimming: trim redundant prompt content, limit output length, split long documents into segmented tasks, and retrieve before generating when necessary.
- Cache reuse: cache results for identical or highly similar requests, and reuse prefix caching for system prompts and fixed prefixes, which can significantly reduce repeated computation.
- Streaming responses: emit the first token as early as possible to improve perceived latency, while preventing long tasks from occupying synchronous connections for extended periods.
- Batching: aggregate multiple small requests into a batch to increase output per unit of resource.
- Retry with restraint: use exponential backoff with random jitter, and set a retry budget.
import random, timedef call_with_backoff(fn, max_attempts=3, base=0.5):for i in range(max_attempts):try:return fn()except OverloadedError:if i == max_attempts - 1:raisetime.sleep(base * (2 ** i) + random.uniform(0, 0.3))
4. Architecture-Side Optimization: Elastic Design for Fluctuation
- Deploy across multiple availability zones and instances, with health checks that automatically remove unhealthy nodes.
- Set elastic scaling metrics based on queue length, time to first token, and rejection rate, rather than CPU alone.
- Tiered service guarantees: prioritize critical paths, and degrade or defer non-critical tasks.
- Use a container platform to host inference services, object storage for models and datasets, and logging and monitoring/alerting systems covering latency, throughput, rejection rate, and GPU memory usage.
- Configure client-side circuit breaking and fallback messaging to prevent users from repeatedly submitting ineffective requests during peak hours.
5. Observability: Measure First, Then Optimize
At minimum, collect four categories of metrics: request volume, queueing time, time to first token, and rejection rate, bucketed by model version and context length. With bucketed data, you can determine whether the issue is “too many users” or “a few very long requests dragging down the whole system.” Among Baidu AI Cloud’s related cloud products, general-purpose monitoring/alerting and logging services can be used to build such dashboards and threshold alerts.
6. Troubleshooting Checklist (Execute in Order)
- Are failures concentrated in fixed time windows? If so, it is a capacity rhythm problem; prioritize peak shifting and load smoothing.
- Do failures immediately follow a version update? Wait for instances to become ready and reduce retry frequency.
- Are a few requests using extremely long contexts? Apply length limits and segmented processing.
- Does the client retry without backoff? Fixing the retry strategy usually yields the greatest benefit.
- Is the network jittery? Check connection stability and timeout configuration, but do not treat it as the primary suspect.
7. Conclusion
Most of the time, a “server busy” message is a capacity and scheduling problem rather than a service outage. By getting four things right—retry strategy, request length governance, cache reuse, and elastic scaling—the vast majority of occasional errors will turn into a predictable, smooth experience. If the problem persists during peak hours, evaluate scaling or adjust the service tier based on monitoring data, rather than repeatedly retrying manually.
