How to Rate Limit and Scale LLM Inference When GPU Compute Is Tight

    As demand for large-model chat services grows, GPU capacity quickly becomes the ceiling on concurrency—but the real limit is not raw "compute." It is the combination of VRAM capacity, memory bandwidth, and scheduling efficiency. This article treats inference capacity as a concrete engineering problem: how to measure concurrency accurately, then protect service quality through admission control, scheduling, efficiency tuning, and elastic scaling. It covers the prefill/decode split, a VRAM and KV-cache budget model with a worked example, token-bucket admission control and client-side retry with backoff, server-side techniques like continuous batching and paged KV memory, priority scheduling and graceful degradation, the metrics to watch (TTFT, TPOT, KV occupancy), and practical patterns for anyone building on top of model APIs.

    In July 2026, a major large-model chat service announced that it would pause new membership sign-ups due to tight compute. Almost immediately, “GPU count sets the concurrency ceiling for a chatbot” became a hot topic in developer circles. A popular but somewhat crude version of the claim goes: however many GPUs you have, that’s how many users you can serve at once. The direction is right, but it skips a crucial detail—what actually gets consumed is not the vague notion of “compute,” but a combination of VRAM capacity, memory bandwidth, and scheduling efficiency. GPUs are not sitting idle waiting for users. The decode phase, which continuously streams tokens, already saturates memory bandwidth on its own: every token emitted unloads one span of context and loads the next request.

    This article abstracts that phenomenon into a general engineering problem: when inference compute becomes the bottleneck, how do you accurately measure concurrency capacity and safeguard service quality through rate limiting, scheduling, efficiency gains, and elastic scaling? Whether you build your own inference service, assemble an AI application, or select compute resources as an architect, you can use this to establish a practical capacity-governance approach.


    1. How Compute Governs Concurrency: VRAM and Bandwidth Are the Real Constraints

    1.1 Prefill vs. Decode: Two Phases, Two Different Bottlenecks

    Autoregressive generation in a large language model splits into two phases with very different bottlenecks:

    • Prefill: Processes the entire input in parallel at once and produces the first token. This is a compute-intensive phase with large matrices, bounded mainly by compute (FLOPS). It directly determines time to first token (TTFT).
    • Decode: Generates tokens one at a time, processing a single new token per step but reading the entire history’s key-value cache (KV Cache). Each token requires moving the model weights and all historical KV from VRAM to the compute units. The floating-point work done per step is proportional only to the number of model parameters (roughly 2N—one multiply and one add per parameter) and is independent of context length. The result is an extremely thin compute-to-memory ratio—a classic memory-bandwidth-bound workload, limited mainly by VRAM bandwidth. This determines time per output token (TPOT).

    An analogy: prefill is like a bus carrying all passengers to the destination in one trip, running at full tilt; decode is like a taxi dropping each passenger off at their own doorstep—the engine may be redlined, but the true bottleneck is the “fuel line” from engine to wheels, i.e., memory bandwidth.

    1.2 The VRAM Budget: How Available KV Space Gets Divided

    A single accelerator card’s VRAM budget can be roughly broken down as:

    1. per-card VRAM ≈ model weights + framework/communication overhead + activations & temp buffers + KV Cache pool
    2. KV Cache pool = per-card VRAM - weights - framework/communication overhead - activations & temp buffers

    Where:

    • Weights: parameter count × bytes per parameter (e.g., 2 bytes for FP16), then split across cards by tensor-parallelism degree;
    • Framework/communication overhead: the inference engine’s own memory plus buffers needed for parallel communication;
    • Activations & temp buffers: prefill intermediate results, sampling state, etc.; their peak scales with the maximum input length in the batch.

    Once the model size is fixed, the KV Cache pool is roughly a fixed allowance. It determines the total amount of context that can be “on the books” at once. A single request’s KV footprint is approximately:

    1. KV bytes ≈ 2 × num_layers × num_kv_heads × head_dim × seq_len × bytes_per_element

    The factor of 2 accounts for the K and V caches. “num_kv_heads” relates to structures like multi-head attention (MHA) and grouped-query attention (GQA): under GQA, multiple query heads share one KV group, so the number of KV heads is usually far smaller than the number of query heads, and VRAM usage drops several-fold accordingly.

    Use the following snippet to estimate the total context tokens a single card can hold:

    1. def kv_budget(gb_per_card, weight_gb, overhead_gb, kv_bytes_per_token):
    2. """Estimate the total context tokens a single card's KV Cache pool can hold"""
    3. kv_pool_gb = gb_per_card - weight_gb - overhead_gb
    4. return kv_pool_gb * (1024 ** 3) // kv_bytes_per_token
    5. # The parameters below are illustrative values to demonstrate the method,
    6. # not a representation of any real model configuration
    7. budget = kv_budget(
    8. gb_per_card=80,
    9. weight_gb=40, # per-card weight usage after parallel splitting
    10. overhead_gb=10, # framework overhead + activation buffers, etc.
    11. kv_bytes_per_token=128 * 1024, # 128 KiB/token
    12. )
    13. # A single card can hold roughly 244k context tokens at once
    14. print(budget) # 261440

    At 128 KiB/token, an 8K context needs about 1 GiB, while a 128K context needs about 16 GiB. In other words, long contexts compress the number of users a given card can serve by an order of magnitude—which is exactly why the concurrency ceiling is so sensitive to context length.

    1.3 From Token Budget to User Count: The Throughput–Latency Tradeoff

    Assume an average of L tokens of context per user, active for T seconds. The number of concurrent active users a single card can support is roughly:

    1. N ≈ ⌊ KV budget ÷ (L × 1) ⌋ × (T ÷ T)

    More precisely, capacity depends on the combination of “number of requests resident at once” and “average request residence time.” At steady state, a card’s effective throughput (tokens/s) is approximately the number of in-flight tokens divided by the average per-token latency:

    1. throughput ≈ in-flight tokens ÷ average TPOT

    Because decode is memory-bandwidth-bound, a larger batch means each weight-loading step serves more tokens, so throughput usually rises—but the per-step compute and memory traffic also grow, and TPOT lengthens.

    This leads to the central tension of inference serving: throughput and latency pull against each other. A larger batch yields higher total throughput but a slower per-user experience; a smaller batch responds more promptly but may leave the GPU “underfed.” So capacity planning cannot fixate on “peak QPS” alone. It should constrain two SLO curves—TTFT and TPOT—at the same time and find an operating point that satisfies both.

    2. Why “Limiting” Beats “Waiting”

    When compute is tight, some services choose to pause new sign-ups. This looks “conservative,” but it is actually a common protective move in capacity governance, for three reasons:

    1. Queuing doesn’t save compute—it destroys experience. Under overload, if you accept everyone and queue without limit, once the arrival rate exceeds the service rate the queue only grows. Even when throughput is near its limit, users may wait tens of seconds for the first token, and many requests are forced to retry after timing out, further worsening the overload.
    2. Long-context and multimodal requests “siphon” VRAM. A single very long input or high-resolution image can consume several to tens of times the VRAM and compute of an ordinary request. Without an admission threshold, a few heavy requests can bring down the whole service.
    3. Experience stability is the core value of a paid product. For subscription products, protecting the service level of existing users is often more commercially rational than indiscriminately accepting new traffic. This strategy itself confirms that a chat service’s concurrency ceiling is fundamentally determined by GPU VRAM and bandwidth.

    The mature approach is not to “slam the gate shut,” but tiered admission + graceful degradation: prioritize high-priority traffic before scaling catches up, while using scheduling and efficiency techniques to buy headroom. Let’s start with a minimal admission-control implementation.

    3. Admission Control: From “Accept Everything” to “Admit Only What You Can Serve”

    The idea behind admission control is: before each request enters the scheduling queue, estimate the VRAM and compute it will occupy. If admitting it would breach the safety watermark, reject it quickly or route it to a degradation channel—rather than enqueueing it into a long line destined to time out.

    1. import time
    2. class TokenBucket:
    3. """Token-bucket admission limiting: allows bursts, caps the long-term rate"""
    4. def __init__(self, rate: float, capacity: float):
    5. self.rate = rate # tokens replenished per second (QPS quota)
    6. self.capacity = capacity # bucket capacity, the max allowed burst
    7. self.tokens = capacity
    8. self.last = time.monotonic()
    9. def allow(self, cost: float = 1.0) -> bool:
    10. now = time.monotonic()
    11. # Replenish tokens based on elapsed time, capped at bucket capacity
    12. self.tokens = min(self.capacity,
    13. self.tokens + (now - self.last) * self.rate)
    14. self.last = now
    15. if self.tokens >= cost:
    16. self.tokens -= cost
    17. return True
    18. return False
    19. def admit(request, limiter, max_input_tokens, max_output_tokens,
    20. free_kv_budget, max_batch_tokens):
    21. """Decide holistically whether a single request can be admitted"""
    22. kv_cost = (request.input_tokens + max_output_tokens) * request.kv_per_token
    23. # 1. Deduct tokens by request "size": long-context, multimodal, etc. consume more quota
    24. cost = request.cost_weight # can be weighted by input length, modality, etc.
    25. if not limiter.allow(cost):
    26. return False, "rate_limited" # fast 429, with a suggested retry time
    27. # 2. A single request must not exceed the context limit
    28. if request.input_tokens + max_output_tokens > max_batch_tokens:
    29. return False, "context_too_long"
    30. # 3. VRAM watermark safety: reserve enough KV space for requests already generating
    31. if kv_cost > free_kv_budget:
    32. return False, "kv_budget_exhausted"
    33. return True, "admitted"

    In practice, two more points matter:

    • Rejectability: some tasks (like code execution) can’t be paused mid-way and should be rejected outright or queued, rather than partially admitted;
    • Usage-based billing friendliness: token-weighted limiting naturally fits pay-per-token models, avoiding the unfairness of “one super-long request occupying just a single concurrency slot.”

    Rejected requests should receive a clear error code and a suggested retry time (e.g., HTTP 429 + Retry-After). Clients should use exponential backoff + jitter so they don’t all retry at the same instant and create a “retry storm”:

    1. def call_with_backoff(send, max_retries=5, base=0.5, cap=30.0):
    2. for attempt in range(max_retries + 1):
    3. try:
    4. return send()
    5. except RateLimited as e:
    6. if attempt == max_retries:
    7. raise
    8. # Prefer the server's suggested retry time, then add jitter
    9. delay = min(max(e.retry_after or 0, base * (2 ** attempt)), cap)
    10. time.sleep(delay + random.uniform(0, delay * 0.3))

    4. Server-Side Efficiency: Doing More on the Same GPUs

    Admission control answers “whether to admit.” Scheduling and inference optimizations answer “how many more users can the same card serve.”

    1. Continuous batching: traditional static batching requires a batch to start and finish together, so requests that finish early just idle. Continuous batching schedules per decode iteration—any sequence that finishes exits and frees resources immediately, and new requests can slot in anytime, significantly raising GPU utilization.
    2. Paged KV memory management: borrowing the paging idea from OS virtual memory, the KV Cache is split into fixed-size blocks allocated on demand, greatly reducing internal and external fragmentation caused by unpredictable lengths—so more concurrent sequences fit in the same VRAM.
    3. Prefix cache reuse: if shared prefixes such as system prompts, long documents, or multi-turn history are submitted repeatedly, their KV results can be cached, so later requests only compute the new portion. This sharply cuts the compute cost of repeated prefill and is especially suited to RAG and agent scenarios with a “long fixed prefix + short changing suffix.”
    4. Context slimming: summarizing and compressing earlier turns in a multi-turn conversation, or re-ranking and deduplicating retrieved fragments in retrieval-augmented setups, directly reduces per-request KV footprint and prefill cost.
    5. Splitting long and short requests: route requests to different resource pools or batch queues by input length and estimated output length, so a single very long task doesn’t stall all the short requests in the same batch.
    6. Quantization: using lower-precision formats for weights and the KV Cache reduces per-card weight usage and KV bytes, effectively enlarging the KV budget—though you must evaluate the impact on output quality alongside it.

    5. Scheduling and Elasticity: Smoothing Out Peak Load

    Tiered scheduling. Set independent concurrency and token-rate quotas for different tiers or tenants, use weighted fair scheduling to ensure relative fairness across tenants and prevent a single heavy user from hogging all resources, and reserve a “fast lane” for interactive requests to protect TTFT.

    Elastic scaling. The scaling metric for an inference cluster should not be CPU utilization. GPUs run at high utilization for long stretches during decode, so CPU metrics can’t reflect real pressure. More meaningful signals include:

    • Number of queued requests / wait time;
    • TTFT percentiles;
    • KV Cache occupancy and remaining VRAM.

    Because model loading and warmup take a while, scaling should combine predictive + reactive strategies: pre-warm ahead of time based on historical traffic patterns, and keep a small pool of hot-standby instances for sudden spikes.

    Priority preemption and graceful degradation. Under resource pressure, schedule by priority and preempt low-priority tasks when necessary. Degradation can be applied step by step:

    • Shorten the per-request output-length cap;
    • Pause non-core inference tasks (e.g., offline summarization, batch generation);
    • Temporarily narrow the allowance for very long contexts;
    • Migrate interactive requests to a scaled-up resource pool via a fallback queue rather than cutting them off outright.

    6. Observability: See the Bottleneck Before Adding GPUs or Tuning

    The prerequisite for capacity governance is “being able to see.” At minimum, collect the following metrics:

    Category Key Metrics What It Tells You
    User experience P50/P95/P99 of TTFT / TPOT Distinguish “average usable” from “tail degradation”
    Throughput Input/output tokens/s, tokens/s per card Measure the true efficiency of per-card output
    Queueing Queue length, average wait time, rejection rate Determine whether you’ve entered overload territory
    VRAM KV Cache occupancy, remaining budget, preemption/swap counts Pinpoint the real constraint on the concurrency ceiling
    Cache Prefix-cache hit rate, block reuse rate Assess the payoff of efficiency techniques
    Hardware GPU utilization, memory-bandwidth utilization Tell compute-bound from bandwidth-bound

    Two reading tips:

    • GPU utilization near saturation but throughput flat and TPOT climbing means the bottleneck has shifted from compute to memory bandwidth and KV capacity. Blindly adding cards yields little; instead, prioritize improving batch efficiency and prefix-cache hit rate.
    • High TTFT with stable TPOT usually points to queueing or heavy prefill; prioritize scaling the ingress side, enabling prefix caching, and splitting off long requests.

    On this basis, set tiered SLOs for different plans, and use chaos engineering to regularly drill overload scenarios to verify that rate limiting and degradation strategies work as expected.

    7. What This Means for Builders: Design Model Serving as an Elastic Resource

    Compute pressure isn’t just one service’s problem—it reminds every developer building AI applications that model inference is an elastic resource with a capacity ceiling, and should be architected accordingly:

    1. End-to-end timeouts and retries: set sensible connect and read timeouts for each model call, and use jittered backoff for retryable errors;
    2. Streaming output: prefer streaming responses so the first token appears early, markedly improving perceived experience;
    3. Asynchronous tasks: long-running jobs like report generation and batch processing should be submitted for async execution—return a task ID first, then deliver results via callback or push notification—instead of holding a synchronous connection for a long time;
    4. Result caching: apply semantic-level caching for identical or similar requests, returning a cache hit directly;
    5. Fallback plan: when the primary model is unavailable, automatically switch to a backup model or return a retrieval-based fallback answer to keep the core path available;
    6. Cost awareness: track token consumption as a first-class metric, and set internal quotas for very long contexts and high-frequency calls to prevent abnormal usage from amplifying compute pressure.

    If your team uses a hosted inference service on the cloud (such as the large-model services offered by Baidu AI Cloud), you can typically use a “pay-per-token” calling model to shift the capacity pressure of peak compute to the platform, and focus your own effort on business logic and experience optimization.

    8. Conclusion: Capacity Is Computable, Schedulable, and Governable

    Back to the opening question: how should we view a large-model service pausing new sign-ups due to tight compute?

    From a technical perspective, this underscores that a chat service’s concurrency ceiling is jointly determined by GPU VRAM capacity + memory bandwidth + scheduling efficiency—not something captured by the one-liner “however many cards you have, that’s how many users you serve.” Pausing sign-ups is only short-term “throttling”; the long-term “opening up of supply” depends on systematic capacity governance:

    • Admission layer: limit by size and priority, rejecting fast instead of letting requests time out in the queue;
    • Inference layer: continuous batching, paged memory management, prefix-cache reuse, and quantization;
    • Scheduling layer: fair scheduling, long/short splitting, predictive elastic scaling, and graceful degradation;
    • Observability layer: a tiered SLO system centered on TTFT, TPOT, and KV occupancy.

    Compute will eventually become abundant as hardware advances and engineering improves, but the ability to “serve users stably under limited resources” is the true moat of large-scale AI services.