LLM Serving Rate Limits and GPU Scheduling: A Practical Guide

    This article explains why large language model (LLM) services slow down and become more expensive as usage grows, and how rate limits and compute scheduling address the underlying constraints. It covers how KV cache consumes scarce GPU memory, how to separate performance degradation from partial outages, what client callers should do to build resilience, supply-side tactics such as time-based pricing and concurrency isolation, and how to run reproducible load tests for capacity planning. Readers will find engineering conclusions and a practical checklist for maintaining stable inference under tight supply.

    1. The Phenomenon: Why LLM Services Get Slower and More Expensive Over Time

    Recently, several LLM services in the industry have experienced slower responses, higher generation latency, occasional request failures, and even short-term unavailability after a rapid increase in call volume. These issues are often followed by a set of “restrictive” measures: idle long sessions are no longer continued, the single-input length limit is lowered, daily conversation quotas are capped, and requests are queued during peak hours.

    On the surface, these measures look like product strategy, but they are an inevitable result under resource constraints. The core bottleneck of LLM inference is usually not network bandwidth, but GPU memory capacity and GPU memory bandwidth. Understanding this is the key to understanding why rate limits, time-based pricing, and concurrency caps are effective.

    2. Root Cause: Why KV Cache Consumes Scarce GPU Memory

    Autoregressive generation models need to keep the Key/Value tensors of already-processed tokens resident in GPU memory during inference. This is the KV cache. Its purpose is to avoid recomputing historical context, thereby accelerating generation and maintaining context consistency.

    The key problem is that KV cache usage is roughly proportional to “context length × number of concurrent sessions,” and the cache must be retained as long as the session is active. A long-inactive but still “existing” session will continuously occupy GPU memory, forming a typical resource zombie.

    Schematically, the capacity constraint can be understood with the following pseudocode:

    1. # Illustrates the capacity relationship only; not a real API
    2. kv_bytes_per_token = layers * 2 * kv_heads * head_dim * dtype_bytes
    3. session_kv = kv_bytes_per_token * context_len
    4. max_concurrent = gpu_mem_budget // session_kv
    5. print(max_concurrent)

    From this, three engineering conclusions follow:

    • Limiting overly long idle sessions is equivalent to reclaiming GPU memory and is the most direct way to scale capacity;
    • Lowering the single-input limit reduces the peak GPU memory per session and lowers the probability of OOM;
    • A concurrency cap (rate limiting per account) slices the GPU memory budget into controllable shares, preventing a few users from crowding out the global pool.

    3. Stability Perspective: Handling Performance Degradation and Partial Outages Separately

    Service anomalies are not limited to “downtime.” The industry usually divides failures into two categories: one is performance degradation, showing up as longer time-to-first-token, lower generation throughput, and occasional failures, where users may still successfully submit requests; the other is partial outage, where a certain entry point or a certain capability becomes unavailable.

    From an engineering standpoint, these two categories are handled completely differently:

    • Performance degradation is mostly related to queuing, GPU memory pressure, and batching strategy, and should be mitigated through rate limiting, degradation, scaling, and off-peak scheduling;
    • Partial outages are mostly related to dependent components, configuration changes, and single points of failure, and require circuit breaking, isolation, and fast rollback.

    Availability metrics also need to be viewed rationally. If a certain type of API has an availability of 99.46%, that translates to a theoretical downtime of about 47.3 hours over a year of 8760 hours; 99.74% corresponds to about 22.8 hours. This reminds architects that the core path must assume dependencies will fail and must design for retries, idempotency, and fallbacks.

    4. The Right Approach for Clients and Callers

    In the face of rate limits and fluctuations, callers should build “resilience” into their code rather than throwing failures directly at users:

    1. request -> estimate tokens -> local rate limiting -> timeout control -> exponential backoff retry -> degraded reply/queue notice

    Key points include:

    • Input-side trimming and summarization: segment and summarize overly long context first, then feed it into the main conversation;
    • Idempotency keys: attach an idempotency identifier to each generation request to avoid duplicate billing and duplicate writes caused by retries;
    • Timeouts and budgets: set a token budget and wall-clock timeout for each request to prevent long tails from exhausting the thread pool;
    • Cache reuse: arrange stable system prompts and knowledge snippets in a prefix-cache-friendly order to improve hit rate;
    • Observability: instrument time-to-first-token, total latency, failure codes, and retry counts to form a basis for capacity decisions.

    5. Supply-Side Scheduling: Time-Based Pricing and Concurrency Isolation

    During periods of tight compute supply, service providers commonly use three tactics to actively “shave peaks and fill valleys”:

    1. Peak/off-peak time-based pricing: off-peak prices are about half of peak-hour prices, using price signals to guide batch tasks to run off-peak;
    2. Concurrency quota isolation: set account-level concurrency caps for different capabilities/model tiers to avoid mutual interference;
    3. Session lifecycle governance: clean up long-idle sessions to reclaim KV cache and GPU memory.

    For developers, the right response is to schedule offline batch processing, evaluation, and data cleaning tasks during off-peak hours, and to keep the online interactive path in an independent resource pool so it is not dragged down by batch tasks.

    6. Capacity Planning and Load Testing Methods

    It is recommended to replace guesswork-based scaling with “reproducible load testing”:

    • Variables: concurrency, average input length, average output length, time-to-first-token target;
    • Metrics: P95/P99 latency, failure rate, GPU memory usage curve, queue time;
    • Method: apply load in steps, find the inflection point, then leave 30% headroom as a safety margin.

    Schematic load-testing pseudocode:

    1. for concurrency in [10, 20, 40, 80]:
    2. run_load(concurrency=concurrency, input_len=4000, output_len=512)
    3. report(p95_latency, error_rate, mem_peak)

    7. A Practical Checklist

    • Sessions: set idle timeouts and a maximum context length; reclaim as soon as idle;
    • Entry points: separate online and offline pools, with independent concurrency and independent quotas;
    • Pricing: route batch tasks to off-peak hours where possible, cutting cost by roughly half;
    • Resilience: have the full set of timeout, backoff, idempotency, and degradation in place;
    • Observability: drive scaling decisions with latency percentiles and failure codes;
    • Communication: clearly inform users of quotas and degradation notices to reduce complaints and misunderstandings.

    8. Conclusion

    Rate limits are not a “capability regression,” but a reallocation of resources under GPU memory and compute constraints. If developers can combine KV cache lifecycle management, concurrency isolation, time-based scheduling, and client resilience, they can maintain a stable experience during tight supply. On the enterprise side, general cloud capabilities such as container platforms, monitoring and alerting, and log services can be used to build an inference architecture that is elastically scalable, observable, and degradable.