LLM Inference Performance Bottlenecks and Compute Scheduling: A Practical Guide to TTFT, TPS, and Capacity Management

    This article breaks down large language model inference performance into measurable engineering signals, focusing on Time To First Token (TTFT) and Tokens Per Second (TPS) as the core metrics behind perceived speed in interactive coding and conversational development. It explains why subscription pauses are usually a symptom of queueing and concurrency scheduling rather than a product decision, why reasoning-effort tiers only partially improve experience, and how to treat tokens as a managed budget. You will find capacity estimation thinking, request classification and fallback strategies, the key trade-offs of caching and batching, observability baselines, and separate optimization checklists for developers and platform teams, with illustrative pseudocode throughout.

    In intelligent coding and conversational development, whether a model is “usable” and whether it “feels good to use” are increasingly defined by two metrics: Time To First Token (TTFT) and Tokens Per Second (TPS). When compute supply becomes temporarily tight, a provider may restrict subscription entry points. Users experience this as “I can’t buy it,” but the underlying issue is queueing and concurrency scheduling across the inference cluster. This article does not focus on any specific product. Instead, it abstracts the phenomenon into a general engineering problem: which stages determine inference performance, why reasoning-effort tiers can only mitigate part of the experience, and what developers and platform operators can each optimize. It outlines capacity estimation approaches, request classification and degradation strategies, and the critical trade-offs of caching and batching, with illustrative code to help readers build a reusable method for performance evaluation and stability assurance.

    1. Abstracting the Phenomenon: From “Subscription Paused” to “Inference Queueing”

    What users see as a “paused subscription” is usually the result of three overlapping signals from an engineering perspective.

    The first is a capacity signal. Inference services differ from traditional stateless web services: every request occupies GPU memory and compute units, and the occupancy duration correlates positively with generation length. Once concurrent requests exceed the steady-state range the cluster can handle, queueing time rises non-linearly.

    The second is a cost signal. Long context, long outputs, and multi-step reasoning all amplify the compute consumed by a single request. If pricing does not match resource consumption, the platform tends to throttle entry points to protect overall service quality.

    The third is an experience signal. As queues lengthen, TTFT rises and the “instant feedback” feel of interactive coding breaks down, leading users to subjectively judge the service as unavailable.

    Therefore, discussing this kind of issue should not stop at “can I buy it.” It should return to measurable engineering metrics: queue wait time, TTFT, TPS, tokens consumed per request, timeout rate, and retry rate.

    2. Performance Breakdown: Why TTFT and TPS Are the Core Metrics

    TTFT (Time To First Token) is the time from sending a request to receiving the first output token. It includes three stages: network round trip, queue wait, and prefill computation. In interactive scenarios, TTFT affects perceived experience far more than total duration, because users need a confirmation point that “the response has started.”

    TPS (Tokens Per Second) is the number of tokens generated per second during the decode phase, and it determines the “flow speed” of long answers. Decoding is an autoregressive process that generates tokens one by one, and it is significantly affected by GPU memory bandwidth and batch size.

    The optimization directions for the two often conflict: increasing batch throughput improves overall utilization but may lengthen per-request queueing and TTFT; reducing batch size improves single-request latency but sacrifices total cluster throughput. This is one of the root causes of a poor “sense of speed.”

    Illustrative evaluation script (pseudocode):

    1. def evaluate_streaming(client, prompt, max_tokens=512):
    2. t0 = now()
    3. first_token_at = None
    4. count = 0
    5. for chunk in client.stream(prompt, max_tokens=max_tokens):
    6. if first_token_at is None:
    7. first_token_at = now()
    8. count += 1
    9. ttft = first_token_at - t0
    10. total = now() - t0
    11. tps = count / max(total - ttft, 1e-6)
    12. return {"ttft_ms": ttft * 1000, "tps": tps, "total_s": total}

    3. Reasoning-Effort Tiers: Why They Mitigate Rather Than Solve

    Tiers such as “high reasoning / low reasoning” essentially let the model invest a variable number of reasoning steps before answering. Lowering the effort does reduce compute consumption in the prefill and reasoning stages and shortens total duration, with a direct improvement for verbosity caused by over-reasoning.

    But it cannot change two things: first, the TPS ceiling determined by the token-by-token nature of the decode stage; second, TTFT jitter caused by queueing during peak periods. In other words, effort tiers optimize the “workload of a single request,” while queueing and bandwidth bottlenecks are “system supply problems.” Conflating the two leads to the conclusion that “it is still slow after switching modes.”

    The practical recommendation is to treat mode selection as part of request policy rather than as a performance switch:

    • Interactive completion and code snippet generation: low effort plus small max_tokens, prioritizing lower TTFT.
    • Architecture design and root-cause analysis of defects: high effort plus a longer output budget, accepting higher latency.
    • Batch refactoring and documentation generation: execute asynchronously through a queue, fully decoupled from the interactive path.

    4. Capacity and Cost: Managing Tokens as a Budget

    One root cause of tight compute is that token consumption on the demand side lacks constraints. Engineering practice should treat tokens as a budget resource and establish a closed loop of “budget, quota, and alerting.”

    1) Context governance. In retrieval augmentation, control the number of recalled fragments and deduplicate them, avoiding stuffing an entire document into the context; summarize and compress conversation history, keeping conclusions and discarding intermediate steps.

    2) Output constraints. Set max_tokens limits per task type. Structured output (such as JSON) consumes fewer tokens than free text and is also easier to validate.

    3) Cache reuse. Introduce semantic caching or result caching for requests with strong determinism (same prompt, same code context), which can significantly reduce repeated computation.

    4) Tiered routing. Split requests into channels for “real-time interactive / near-real-time / offline batch,” and configure different concurrency and timeouts for each channel.

    Illustrative routing policy:

    1. def route(req):
    2. if req.kind == "completion":
    3. return Lane(realtime=True, max_tokens=256, thinking="low")
    4. if req.kind == "analysis":
    5. return Lane(realtime=True, max_tokens=2048, thinking="high")
    6. return Lane(realtime=False, queue="batch", max_tokens=4096)

    5. Stability Design: Rate Limiting, Degradation, and Observability

    Facing temporary supply constraints, both the client side and the platform side need graceful degradation plans.

    On the rate-limiting side, use a token bucket to control local request rate, combined with exponential backoff retries, to avoid a retry storm that further amplifies queueing.

    On the degradation side, prepare multi-level fallbacks: prefer a high-capability model, switch to a smaller and faster model after a timeout, and if that also fails, return a templated result or prompt the user to retry later, keeping the pipeline from breaking.

    On the observability side, you must collect TTFT, TPS, queue duration, error code distribution, and token consumption, and establish baselines by task type. Without baselines, you cannot tell whether “slow” is a model problem, a network problem, or a problem with your own prompt construction.

    1. def call_with_fallback(task):
    2. for model in task.fallback_chain: # from strongest to weakest
    3. try:
    4. return model.run(task.prompt, timeout=task.timeout)
    5. except TimeoutError:
    6. continue
    7. return task.template_result()

    6. Developer-Side Optimization Checklist

    • Use streaming output to improve perceived experience: deliver structure first, then fill in details.
    • Trim prompts; remove ineffective examples and redundant constraints.
    • Split long tasks into parallelizable subtasks to shorten the critical path.
    • Validate stable outputs locally and repair them automatically to reduce follow-up requests.
    • Build local benchmarks and regression-test TTFT and TPS after every prompt or parameter change.

    7. Platform-Side Optimization Directions (General Capability View)

    • Apply general inference optimization approaches such as continuous batching and paged attention to improve GPU memory utilization.
    • Use container platform auto-scaling to handle peaks, combined with message queues to level the load.
    • Use monitoring, alerting, and logging services to locate long-tail requests and separate queueing time from computation time.
    • Offer multiple model tiers and effort configurations so users can choose their balance point between cost and latency per scenario.

    8. Conclusion

    “Can’t buy a subscription” is only the surface. What deserves attention is the latency structure of inference services and the governance of compute budgets. By bringing TTFT, TPS, and token consumption into daily measurement, along with request classification, cache reuse, rate limiting and degradation, and an observability system, developers can maintain a stable interactive experience during supply fluctuations, while platform operators can achieve higher effective throughput with limited compute. Performance problems have never been solvable by tuning a single parameter; they are a systems engineering effort spanning from prompt construction to cluster scheduling.