Where Does the Compute Go? The Capacity Crunch Behind Rate Limits on Domestic LLMs

    Recent rate limits on some LLM services—covering call counts, concurrency, or token usage—are often interpreted as stricter usage policies. From an engineering perspective, however, they are first a resource-allocation problem. This article explains why LLM inference consumes scarce accelerator time and memory, analyzes four causes of compute pressure, reviews common rate-limiting dimensions and the token bucket algorithm, and outlines practical responses for developers and capacity-planning considerations for enterprises.

    1. The Core Issue: Compute Is a Finite Resource

    Recently, some LLM services have imposed limits on call counts, concurrency, or token usage. Many developers interpret this as service providers tightening their usage policies, but from an engineering perspective, rate limiting is first a resource-allocation problem. Every token generated during LLM inference consumes compute time on accelerator chips and also requires memory to store the cache corresponding to the context. The longer the request and the higher the concurrency, the more resources are consumed per unit of time. When demand growth exceeds available compute, service providers can maintain overall availability only through queuing, degradation, or rate limiting.

    Understanding this point helps clarify the nature of rate limits. If they come from a short-term supply-demand mismatch, they will usually ease as capacity expands. If they stem from excessively high resource consumption per request, long-term optimization is needed in model selection and invocation patterns.

    2. Four Causes of Compute Tightness

    1. Long hardware supply cycles. The production, packaging, and delivery of high-performance accelerator chips take months or even longer, while the user base can grow rapidly within a few months. A natural time gap exists between expansion plans and the demand curve.

    2. Inference load amplifies with usage depth. Multi-turn dialogue repeatedly carries historical content, and long-document analysis and codebase understanding can push the context to a large scale. During inference, the key-value cache portion of memory usage grows linearly with context length and concurrency. The same hardware can therefore support fewer concurrent requests, and unit cost rises accordingly.

    3. Training and inference compete for resources. Model iteration requires large-scale training clusters, while online inference requires stable service capacity. When both types of workloads are scheduled in the same resource pool, a peak in either one can squeeze the other.

    4. A large gap between peak and average. Daily traffic is often only a fraction of peak traffic. Provisioning for peak leaves resources idle most of the time; provisioning for average inevitably leads to queuing during peak periods. This contradiction is especially prominent in public-facing services.

    3. Design Logic of Rate Limiting

    Rate limiting does much more than reject requests. It has three goals: protect system stability, prevent a single user or a single task from monopolizing resources, and allocate access opportunities as fairly as possible when capacity is limited.

    Common rate-limiting dimensions include the following:

    • Request count: the number of calls allowed per minute or per second.
    • Tokens: measured by the total number of input and output tokens, which is closer to actual resource consumption.
    • Concurrency: the number of unfinished requests allowed to exist at the same time.
    • Priority: reserve quota for critical business, internal tasks, or specific plans.

    The token bucket is a commonly used rate-limiting algorithm in engineering. The bucket refills tokens at a fixed rate, and each request consumes a corresponding number of tokens. The bucket capacity determines the upper limit of burst traffic that can be tolerated.

    1. import time
    2. class TokenBucket:
    3. def __init__(self, rate: float, capacity: float):
    4. self.rate = rate # tokens refilled per second
    5. self.capacity = capacity # bucket capacity, determines burst tolerance
    6. self.tokens = capacity
    7. self.last_ts = time.monotonic()
    8. def allow(self, cost: float = 1.0) -> bool:
    9. now = time.monotonic()
    10. elapsed = now - self.last_ts
    11. self.tokens = min(self.capacity, self.tokens + elapsed * self.rate)
    12. self.last_ts = now
    13. if self.tokens >= cost:
    14. self.tokens -= cost
    15. return True
    16. return False

    If cost is set to the estimated token count for the current request, token-based rate limiting can be implemented. This example is only intended to illustrate the principle. A production environment also needs to handle thread safety and place state in shared storage when deployed across multiple instances.

    4. Developer Response Strategies

    1. Control context length. Periodically trim dialogue history and keep only content relevant to the current task. Using summaries instead of full text can often significantly reduce token consumption per request.

    2. Separate real-time and offline tasks. Latency-insensitive batch work, such as data labeling, document archiving, and offline evaluation, should be placed in asynchronous queues and scheduled during off-peak periods. Real-time interaction should be reserved only for scenarios that users can directly perceive.

    3. Cache repeated results. For requests with the same prompt and input, the output can be cached. The cache needs a clear invalidation policy and must be cleared when the model version or prompt changes.

    4. Use backoff retry. When a rate-limit response is encountered, retry with exponential backoff plus random jitter instead of resending immediately. This reduces congestion and prevents request spikes caused by many clients retrying at the same time.

    1. import random
    2. import time
    3. def call_with_backoff(fn, is_rate_limited, max_retries: int = 5):
    4. for attempt in range(max_retries):
    5. result = fn()
    6. if not is_rate_limited(result):
    7. return result
    8. delay = min(2 ** attempt, 30) + random.uniform(0, 1)
    9. time.sleep(delay)
    10. raise RuntimeError("Maximum retry count exceeded; check quota or reduce request frequency")
    1. Design degradation paths. When an LLM service is unavailable or limited, switch to a rule engine, a smaller model, or cached answers to ensure that core business processes are not interrupted.

    5. Capacity Planning for Enterprises

    When planning LLM applications, enterprises usually estimate demand first and then decide on a resource mix. A rough estimation approach is as follows:

    Required throughput = average daily requests × average tokens per request ÷ effective service hours × peak factor

    The peak factor reflects the ratio of business peak to average. This factor should be derived from real access logs and should not be set arbitrarily based on experience.

    After obtaining the demand estimate, enterprises generally face choices such as:

    • Public cloud elastic resources: fast to start, pay-as-you-go, suitable for workloads with large traffic fluctuations or in the experimental phase.
    • Private deployment: data controllability.