Managing LLM Inference Capacity: Rate Limiting, Scaling, and Scheduling in Practice
This article explains why several large model providers have introduced rate limits, request queues, and pauses on new user onboarding. It breaks down the cost structure of LLM inference, outlines supply-side risks such as hardware delivery, power, and cooling constraints, and describes how engineering teams can respond with token-based admission control and queue management.
1. Background: Demand Is Outpacing Service Capacity
Over the past period, several large model providers have introduced rate limits, request queuing, or pauses on new user sign-ups. The cause is straightforward. User request volume has grown rapidly within a short time, while expanding an inference cluster takes time. The process includes hardware delivery, data center installation, model loading, and staged validation, and the full cycle often takes weeks or even months. The gap between rising demand and delayed capacity means that service bottlenecks appear first during traffic peaks.
This problem directly affects engineering teams. The availability of an inference service depends not only on whether the model is online. It also depends on how many requests the system can handle per unit of time, whether the wait time for each request stays under control, and how resources are allocated among different customers.
2. Where Inference Costs Come From
Before designing rate limiting policies, teams need to break down inference costs. A single LLM call typically has two stages:
- Prefill stage: The model reads the entire input at once and computes and caches the attention-related intermediate results. Longer inputs take longer in this stage.
- Decoding stage: The model generates output tokens one at a time. Each generated token requires reading the cached context. Longer outputs keep the accelerator busy for more time.
The following relationship qualitatively describes the resource usage of a single request:
Per-request resource usage ≈ input tokens × prefill unit cost + output tokens × decoding unit cost
This formula only helps judge the cost structure. It does not represent actual values. Real costs depend on the model architecture, batching method, hardware configuration, and cache hit rate.
The following types of workloads most easily increase resource pressure:
- Long context: Scenarios such as document question answering and codebase analysis carry large amounts of input. Both prefill cost and cache usage rise.
- Multi-step agent tasks: One user task may trigger multiple rounds of model calls and tool calls. A single task can generate far more requests than an ordinary conversation.
- High-concurrency short requests: A large number of requests adds up scheduling overhead and queuing delays, which build into noticeable tail latency.
- Repeated context: In multi-turn conversations, earlier content is submitted again and again. Without cache reuse, the same content is computed repeatedly.
3. Uncertainty on the Supply Side
Compute supply is affected by several factors. When planning capacity, engineering teams should treat these factors as risks, not as fixed assumptions.
- Hardware delivery: Delivery timelines for accelerator chips depend on upstream production capacity, supply chain pace, and export controls. Planned new capacity may arrive later than scheduled.
- Hardware generation transitions: Different hardware generations vary significantly in compute performance, memory capacity, and interconnect bandwidth. Mixed deployments add complexity to scheduling and model partitioning.
- Data centers and power: New racks require power, cooling, and network conditions to be ready at the same time. These conditions often become hidden bottlenecks for expansion.
- Policy and compliance: Changes in regional regulatory requirements may affect cross-region deployment plans and data residency strategies.
The planning principle is this: build expansion plans around optimistic delivery schedules, and design capacity safeguards around conservative scenarios. Rate limiting and degradation mechanisms absorb the gap between the two.
4. Response Strategies
(1) Admission Control and Rate Limiting
Rate limiting is the most direct protective measure. It blocks requests that exceed the cluster’s capacity at the entry point, which prevents the whole cluster from overloading and degrading the experience for all users at once. A common practice is to set quotas by user, API key, or tenant, and to bill based on estimated token consumption rather than simply counting requests.
The following is a simplified token bucket example that shows how to make admission decisions based on estimated token consumption:
import threadingimport timeclass TokenBucket:"""Token bucket for admission control based on estimated token consumption."""def __init__(self, rate_per_sec: float, capacity: int):self.rate = rate_per_sec # Number of tokens added per secondself.capacity = capacity # Maximum capacity of the bucketself.tokens = float(capacity)self.last_ts = time.monotonic()self.lock = threading.Lock()def try_acquire(self, cost: int) -> bool:with self.lock:now = time.monotonic()elapsed = now - self.last_tsself.tokens = min(self.capacity, self.tokens + elapsed * self.rate)self.last_ts = nowif self.tokens >= cost:self.tokens -= costreturn Truereturn Falsedef estimate_cost(prompt_tokens: int, max_output_tokens: int) -> int:# Use the input length plus the maximum output length as a conservative estimatereturn prompt_tokens + max_output_tokensdef admit(bucket: TokenBucket, prompt_tokens: int, max_output_tokens: int) -> dict:cost = estimate_cost(prompt_tokens, max_output_tokens)if bucket.try_acquire(cost):return {"status": "accepted"}# Return a clear rejection reason and a suggested wait time to keep requests from timing out in the queueretry_after = cost / bucket.ratereturn {"status": "rejected","reason": "token_quota_exceeded","retry_after_sec": round(retry_after, 1),}
The code has two points to note. First, the consumption estimate is conservative because it counts the maximum output length. Actual usage is usually below the estimate, so quotas need a safety margin. Second, the rejection response includes a wait time, so callers can apply backoff and retry instead of repeatedly hitting the entry point.
(2) Queuing and Priority Tiers
When requests exceed immediate processing capacity, they can wait in a queue. However, the queue must have a size limit and a timeout. An unbounded queue causes memory usage to balloon, and tail latency becomes uncontrollable.
