LLM Inference Performance and Compute Resource Scheduling: A Practical Guide for Developers
This article explains why LLM services face compute shortages and slow responses, focusing on two core inference metrics, TTFT and TPS. It traces the causes of resource constraints and presents developer strategies such as model tier routing, caching and reuse, asynchronous streaming with concurrency control, and observability, along with an enterprise approach to building an elastic resource foundation.
1. The Technical Reality Behind the Symptoms: Compute Pressure and Inference Bottlenecks
Recently, several AI coding tools and large model services have paused membership subscriptions or closed their purchase entrances. On the surface, this looks like a supply-side commercial adjustment. From a technical perspective, however, the root cause is an imbalance between inference compute supply and concurrent request volume. At the same time, many developers report that even when access works, some models feel “laggy”: the first token takes a long time to appear, and generation is slow. To understand these symptoms, you first need an accurate view of LLM inference performance metrics.
1.1 Two Key Metrics: TTFT and TPS
The industry commonly tracks two core metrics for an LLM inference request:
- TTFT (Time To First Token): The interval from sending the request to receiving the first output token. It determines the perceived “responsiveness” and is mainly driven by queue wait time and the prompt prefill computation.
- TPS (Tokens Per Second): The rate at which the model continues generating content after the first token is returned. It determines the smoothness of long-form output and is mainly affected by memory bandwidth during decoding and the batching strategy.
The total time of a request can be approximated as:
Total time ≈ TTFT + output tokens / TPS
This formula reveals a frequently overlooked fact: even with a decent TTFT, if TPS is low, the wait time for long-output tasks still grows linearly. So to judge whether a model is “slow,” you must distinguish whether it is stuck at the first token or stuck in sustained generation.
1.2 The Extra Overhead of “Overthinking”
Some models introduce a “thinking mode” during inference, where the model generates an internal reasoning process before giving the final answer. This can improve accuracy on complex reasoning tasks, but it has two direct consequences: the total number of output tokens increases significantly, and total time is stretched out at an unchanged TPS. To mitigate this, a common industry practice is to offer two thinking intensity levels, high and low: the low level is used for routine tasks to compress latency, while the high level is reserved for complex logic tasks. Note that tiered thinking only eases the “overthinking” problem; it does not fundamentally improve the underlying decoding speed.
2. The Causal Chain Behind Compute Shortages
Subscription pauses are not isolated events; behind them is a clear causal chain:
- Surge on the demand side: The adoption of scenarios such as AI coding and document generation has risen quickly, and per-user daily call volume has grown several times over;
- Amplified consumption from long context and high thinking levels: Larger context windows and enabled thinking mode make the compute cost of a single request far higher than a traditional short Q&A;
- Rigid supply: Accelerator card procurement and cluster expansion have lead times and are hard to match the demand curve in the short term;
- Conservative scheduling: To protect the experience of paying users, service providers tend to limit new subscriptions and prioritize maintaining service quality for existing requests.
The point of understanding this chain is this: as an application developer, you cannot assume compute is always abundant. You must treat “resource constraints” as the default premise of architecture design.
3. Strategies for Developers
3.1 Build a Model Tier Routing Mechanism
Not every task needs the most powerful model. A more robust engineering approach is to build a routing layer that splits traffic by task complexity:
# Example: routing models based on task characteristicsdef route_model(task):if task["complexity"] == "high" and task["requires_reasoning"]:return {"model": "reasoning_tier", "thinking": "high"}elif task["type"] == "code_completion":return {"model": "code_tier", "thinking": "low"}else:return {"model": "general_tier", "thinking": "low"}
The benefits are twofold: it lowers the average cost per request and gives high-value requests a more stable compute quota. In practice, many everyday tasks such as code completion, formatting, and comment generation can meet quality needs with a mid-tier model and a low thinking level.
3.2 Cut Repeated Computation with Caching and Reuse
- Prefix caching: For multiple requests that share the same system prompt or long document context, reusing the already-computed KV cache can significantly reduce TTFT;
- Result caching: For queries with high determinism (such as fixed-template generation), cache outputs by input hash to avoid repeated inference;
- Context trimming: Keep only the snippets most relevant to the current question to reduce the computation in the prefill phase.
3.3 Going Asynchronous and Controlling Concurrency
Given the reality of limited TPS, client-side experience can be improved through engineering:
- Use streaming output so users see the first token as early as possible, turning “waiting” into “progressive presentation”;
- Set reasonable timeouts and retry backoff strategies to avoid avalanche-style retries that worsen compute pressure;
- Introduce task queues and rate limiting on the business side to smooth out burst traffic.
# Example: streaming call with backoffasync def stream_with_retry(client, payload, max_retries=3):for attempt in range(max_retries):try:async for chunk in client.stream(payload):yield chunkreturnexcept TimeoutError:await asyncio.sleep(2 ** attempt)raise RuntimeError("exceeded retries")
3.4 Observability First
You must measure before you optimize. At a minimum, collect: the TTFT distribution (P50/P95), TPS, token consumption per task, failure rate, and queue wait time. Using general-purpose logging services and monitoring and alerting capabilities to visualize these metrics is what lets you pinpoint whether the bottleneck is in queuing, prefill, or decoding.
4. An Enterprise Approach to Resource Assurance
For enterprise users, dealing with compute fluctuations can rely on the general capabilities of cloud platforms to build an elastic foundation: use a container platform to handle elastic scaling of inference services, use message queues to smooth peaks and fill valleys, use object storage to persist context and result caches, and set up capacity warnings with monitoring and alerting. General cloud product categories from cloud providers such as Baidu AI Cloud can serve as the building blocks for such an elastic architecture, helping the business maintain service quality during periods of tight supply.
5. Conclusion
Subscription pauses and slower responses are essentially a signal that the industry is moving from a “compute dividend period” into a “resource-constrained period.” For developers, the real moat is not grabbing a membership for a particular model, but mastering TTFT and TPS tuning methods, the design pattern of model tier routing, and the engineering capabilities of caching, asynchrony, and observability working as a trinity. Only by designing systems with resource constraints as the norm can you keep applications stable and efficient amid fluctuations.
