Local LLM Inference Performance Benchmarking and Tuning: A Practical Guide

    This article explains why a model that runs locally is not necessarily production-ready, and how to benchmark it properly. It defines four core metrics—prefill throughput, decode throughput, TTFT, and the concurrency degradation curve—along with consistent measurement practices. Based on observed local deployment results, it shows that prefill stays healthy across input lengths while degradation comes mainly from concurrency, and that TTFT growth is driven largely by queuing. A three-layer troubleshooting method (queuing, memory and bandwidth, compute and parallelism), a two-dimensional stress-test loop, and an actionable optimization checklist are included.

    1. Why “It Runs” Does Not Mean “Performance Is Acceptable”

    Loading model weights into a local inference environment and successfully returning the first token only proves the pipeline works. It says nothing about production readiness. One of the most common misjudgments in engineering practice is treating the smoothness of a single question-and-answer exchange as an overall performance conclusion. Real workloads are concurrent and have uneven length distributions, so benchmarking must cover the two-dimensional space of “input length × concurrency.” Otherwise, the resulting numbers cannot be extrapolated.

    Another frequent mistake is focusing only on decode speed. What affects the user experience more is often time to first token, and a substantial share of that time comes from queuing rather than computation. If queuing time is not separated from computation time, tuning efforts will head in entirely the wrong direction.

    2. Definitions and Measurement Standards for Four Core Metrics

    • Prefill throughput: The number of tokens computed per second during the input prompt processing stage. It sets the lower bound on time to first token and is usually constrained by compute capacity and matrix multiplication efficiency.
    • Decode throughput: The output speed during the token-by-token generation stage, mainly constrained by memory bandwidth and KV Cache access patterns.
    • TTFT (Time To First Token): The time from request submission to receipt of the first token, equal to queue wait + prefill computation + scheduling overhead.
    • Concurrency degradation curve: The rate at which throughput changes as concurrency rises under the same workload. It is the key to determining whether the service has a real capacity bottleneck.

    When measuring, always fix the sampling precision, warm-up rounds, and memory usage baseline, and state clearly whether dynamic batching is enabled. Comparing two sets of data collected under inconsistent standards is the primary reason a benchmark report loses credibility.

    3. Typical Observed Patterns and Interpretation

    The following is a set of measured results from a local deployment (values are for trend illustration only):

    Metric Observed Result Interpretation
    Prefill peak, single concurrency ~750 tok/s (4k input) Stays at 630–760 across the 2k–32k range with no clear length degradation, indicating full compute utilization in the prefill stage
    Prefill as concurrency rises 2 concurrent: down 30%–45%; 4 concurrent: ~50% down; 6 concurrent: ~63% down With 2k input, drops from ~690 to ~230; compute is split and amortized in an approximately linear fashion
    Decode, single concurrency 24–29 tok/s, stable Single-stream decode sits in a reasonable range for this memory bandwidth
    Decode as concurrency rises 8–18 tok/s; long input + 4–6 concurrency drops to 8–11 Long context inflates the KV Cache, making bandwidth the bottleneck
    TTFT Rises linearly with length; at 32k, ~51s single concurrency, ~187s at 6 concurrent The increment comes mainly from queuing, not computation itself

    Two key conclusions follow. First, prefill performs healthily along the length dimension, and nearly all degradation comes from the concurrency dimension. This means the bottleneck is resource partitioning and scheduling, not the model’s ability to handle long inputs. Second, decode hits a low point when long context is combined with medium-to-high concurrency, then rebounds to 20–28 tok/s at 32k. Such non-monotonic jumps may be sampling noise or changes in batching behavior, so repeated rounds should be added and the median taken before drawing conclusions.

    4. Three-Layer Troubleshooting for Bottleneck Identification

    1. Queuing layer: Measure the difference between request arrival intervals and service start time. If queuing accounts for more than one third of total latency, adjust the maximum concurrency, queue limits, and timeout policy first, rather than changing inference parameters.
    2. Memory and bandwidth layer: Check whether KV Cache usage is approaching the limit and whether swapping or recomputation is triggered. In long-context scenarios, usage can be reduced through paged cache management, cache quantization, sliding windows, and similar techniques.
    3. Compute and parallelism layer: Confirm whether tensor parallel partitioning matches the memory topology, whether operators use efficient implementations, and whether batch assembly lets short requests get held back by long ones.

    A sample stress-test loop can be organized like this:

    1. # Pseudocode: two-dimensional stress-test matrix, output percentiles instead of means
    2. for input_len in [2048, 8192, 32768]:
    3. for concurrency in [1, 2, 4, 6]:
    4. samples = run_benchmark(
    5. prompt_len=input_len,
    6. concurrency=concurrency,
    7. rounds=5, # multiple rounds, take the median to suppress noise
    8. warmup=1,
    9. )
    10. report(input_len, concurrency,
    11. p50=samples.percentile(50),
    12. p95=samples.percentile(95),
    13. queue_ratio=samples.queue_time / samples.total_time)

    5. An Actionable Optimization Checklist

    • Fix and publish the test standards: input length tiers, concurrency tiers, warm-up strategy, and sampling precision.
    • Replace averages with percentiles; P95 reflects the business experience better than the mean.
    • Apply length bucketing and separate queues for long-context requests so long and short requests do not interfere with each other.
    • Configure a reasonable replica count and autoscaling on the container platform side, moving queuing pressure forward to the scheduling layer.
    • Connect benchmark results to monitoring, alerting, and logging services to form a closed loop of “metrics—logs—parameter tuning.”
    • If cloud-based general capabilities are used, object storage (models and datasets), a container platform (inference service orchestration), and monitoring and alerting (latency and throughput dashboards) can be combined to build a standardized benchmarking pipeline.

    6. Conclusion

    The value of benchmarking lies not in producing a nice peak number, but in attributing performance problems to the correct layer. When prefill is stable along the length dimension, declines linearly along the concurrency dimension, and TTFT increments come mainly from queuing, the right action is to scale capacity and optimize scheduling, not to repeatedly tune model precision. Building a benchmarking system with unified standards, percentile-driven reporting, and reproducibility is the foundation for keeping local inference performance continuously under control.