How to Solve LLM Inference Concurrency Bottlenecks
This article explains why concurrency is so expensive in LLM inference, why the bottleneck is memory bandwidth and capacity rather than compute, and how continuous batching, paged KV cache management, quantization, and parallel strategies work together to raise throughput. It also covers the system-level practices needed to run inference at scale, from async I/O and request prioritization to autoscaling and observability.
1. Why LLM Concurrency Is So Expensive
In a traditional web service, concurrency usually means more threads or processes, and the hardware bottleneck typically shows up in CPU compute or network bandwidth. Once the workload becomes large language model (LLM) inference, the rules change completely.
LLM output is not returned in one shot. It is generated token by token in an autoregressive loop. For a simple question, the model may need ten consecutive forward passes to assemble a complete answer. Each forward pass produces a single new token, appends it to the input, and starts the next round. Because of this iterative behavior, a request lives not for milliseconds but for hundreds of milliseconds or even several seconds.
The most naive approach, static batching, collects a group of requests, runs them together, and returns only after the whole batch finishes. This creates a severe “weakest link” effect: if one request in the batch needs to generate 512 tokens and another needs only 5, the second one sits idle waiting for the first. The GPU spends most of its time doing useless computation for sequences that have already finished, so utilization stays very low.
This is the root cause of the tenfold or larger performance gaps seen under high concurrency.
2. The Key Insight: LLM Inference Is Memory-IO Bound, Not Compute Bound
Solving concurrency requires one critical insight: at the current stage, the bottleneck of LLM inference is memory bandwidth and capacity, not floating-point compute.
Put simply, moving weights and the KV cache from GPU memory to the compute units often takes longer than the actual matrix math. What determines throughput is therefore not “how fast the GPU can compute” but “how much batch data you can fit into high-speed memory and keep flowing.”
GPU memory usage comes from two parts:
- Model weights: a fixed cost that scales with model size;
- KV cache: a dynamic cost that grows linearly with the number of concurrent requests and the sequence length.
There is a hard constraint that is easy to overlook: the KV cache expands sharply as sequences get longer. Suppose a model has enough spare memory for 28 concurrent sequences at a sequence length of 512. Raise the sequence length to 2048 and the concurrency ceiling may drop to 7, before even accounting for the space needed by intermediate activations.
This constraint explains why memory optimization delivers outsized returns: every megabyte saved can be converted into more batch capacity, and then into a multiple of throughput.
3. The Core Solution: Continuous Batching
Continuous batching, also called iteration-level scheduling or dynamic batching, is the technique the industry widely recognizes as the answer to the concurrency problem. The idea is straightforward: move the scheduling granularity from the request level down to the iteration level.
Static batching has fixed batch boundaries. Continuous batching removes them: as soon as a sequence finishes and exits, the scheduler immediately fills the freed slot with a request from the waiting queue, without waiting for the rest of the batch.
A schematic scheduling loop in pseudocode:
while engine.is_running():batch = scheduler.pop_active_sequences() # Take the currently active sequenceslogits = model.forward(batch) # One forward passfor seq, token in zip(batch, logits):if token == EOS:scheduler.retire(seq) # Finished sequences exit immediatelyelse:seq.append(token)scheduler.admit_waiting_requests() # Admit new requests right away
The benefits compound:
- No idle spinning: finished sequences stop consuming compute;
- Faster memory turnover: freed KV cache blocks are reused immediately;
- Smoother latency: new requests no longer wait for long ones to finish, so queueing time drops noticeably.
Public engineering reports show that combining continuous batching with supporting memory optimizations can improve throughput by several times up to roughly twentyfold; even local inference setups without deep modifications can gain several times. The exact multiple depends heavily on model size, the distribution of input and output lengths, and hardware configuration, so it cannot be generalized.
4. The Supporting Pillar: Fine-Grained KV Cache Management
Continuous batching is a scheduling-layer optimization. If memory management cannot keep up, fragmentation and reservation waste will still occur frequently. The common industry practice is paged memory management: split the KV cache into fixed-size blocks, allocate on demand and reclaim after use, and link logical sequences to physical blocks through a mapping table.
The value of this approach:
- Avoids wasting memory by reserving contiguous space for the “maximum possible length”;
- Supports prefix sharing, so requests with the same system prompt can reuse the same set of cache blocks;
- Makes dynamic swapping in and out possible, leaving headroom for very long context scenarios.
5. Orthogonal Optimizations: Quantization and Parallelism
Beyond scheduling, two other optimizations are orthogonal to continuous batching.
Weight quantization. Compressing model weights from high-precision floats into low-bit representations directly reduces memory usage and data movement. Since LLM inference is constrained by memory bandwidth, moving less data often yields close-to-linear throughput gains. Such methods usually require only a one-time offline conversion and no change to the model architecture.
Tensor parallelism and pipeline parallelism. When a single GPU cannot hold the model or the KV cache, the model must be split across multiple devices. The choice of parallel strategy directly affects communication overhead and batching flexibility, so it needs to be designed carefully against the network topology.
6. Putting It in Production: From a Single Machine to a Cluster
Real high-concurrency serving also requires an engineering layer on top of the engine capabilities above:
- Ingress: use asynchronous, non-blocking I/O so connection waits do not tie up worker threads;
- Queues and priorities: separate interactive short requests from offline long ones so long jobs do not block critical paths;
- Elastic scaling: trigger scale-out and scale-in based on metrics such as queue depth and memory watermark, with a container platform handling fast instance scheduling;
- Observability: collect core metrics such as time to first token, inter-token latency, and batch fill rate through logging and monitoring with alerting, forming the basis for tuning.
In cloud practice, the inference engine is typically deployed on a container platform, with object storage distributing model files and a message queue smoothing traffic peaks, producing an inference service that is both elastic and operable.
7. Conclusion
The concurrency problem in LLMs looks like “too many requests to handle,” but it is really the memory capacity and bandwidth constraints showing up under iterative generation. The path forward is clear: restructure scheduling granularity with continuous batching, free up memory with paged caching and quantization, and back it all with a clustered ingress, scheduling, and observability layer. Understanding the underlying premise of being memory bound is the first step toward the right technical choices.
