Optimizing Request Admission and Continuous Batching in vLLM Serving
In production Large Language Model (LLM) serving, infrastructure efficiency is defined by two competing metrics: aggregate token generation throughput (tokens per second per GPU) and interactive latency, specifically Time to First Token (TTFT) and Inter-Token Latency (ITL). Traditional static batching architectures fail severely in real-world serving because requests arrive dynamically with highly variable prompt lengths and unpredictably distributed completion lengths. Waiting to assemble static batches leaves compute cores underutilized, while early-completing requests leave memory slots idle. Continuous batching (iteration-level scheduling) addresses this by inserting new requests into active execution iterations at every token generation step. However, naive continuous batching introduces severe performance pathologies: heavy prompt prefill computations can monopolize GPU execution units, starving active token decode streams and inducing massive P99 TTFT latency spikes. Optimizing request admission and continuous batching parameters in modern inference engines like vLLM is essential to maximizing token throughput while rigorously honoring enterprise latency SLAs.
Prerequisites and Diagnostic Baseline: Sizing Memory and Iteration Budgets
Tuning continuous batching requires a precise understanding of the two distinct operational phases of LLM inference: the compute-bound Prefill phase (processing the input prompt to generate the first token) and the memory-bandwidth-bound Decode phase (generating subsequent tokens autoregressively one by one).
GPU Memory Budgeting and KV Cache Allocation
Before modifying scheduler parameters, engineers must calculate the exact physical GPU High Bandwidth Memory (HBM) allocated to the Key-Value (KV) cache. In vLLM, available GPU memory is divided into three primary regions:
- Model Weights Footprint: Fixed memory required to hold model parameters (e.g., ~140GB in FP16 or ~70GB in FP8 for a 70B parameter model).
- Activation and Workspace Scratch: Dynamic memory allocated for intermediate matrix multiplications and tensor core scratchpads.
- PagedAttention KV Cache Pool: The remaining physical memory partitioned into fixed-size block allocations (typically 16 tokens per block) managed dynamically like virtual memory pages.
The available KV cache pool size directly dictates the maximum concurrency the GPU can sustain without swapping cache blocks to host DRAM. Sizing memory utilization is governed by the following baseline parameters:
| vLLM Scheduler Parameter | Default Value | Production High-Concurrency Target | Operational Impact on Throughput & Latency |
|---|---|---|---|
gpu_memory_utilization |
0.90 (90%) | 0.92 to 0.95 | Expands the KV cache block pool; higher values allow more concurrent requests but risk CUDA OOM if activations burst. |
max_num_batched_tokens |
2048 / 4096 | 2048 (Latency) / 4096 (Throughput) | Hard limit on the total number of tokens (prefill + decode) evaluated in a single iteration step. |
max_num_seqs |
256 | 128 to 256 | Maximum number of concurrent request sequences in flight; bounds scheduling overhead and ITL jitter. |
enable_chunked_prefill |
False (vLLM <0.4) | True (Mandatory for production) | Splits long prompt prefills across multiple execution steps, preventing prefill requests from blocking active decodes. |
Step-by-Step Configuration: Implementing Chunked Prefill and Admission Policies

To eliminate TTFT tail latency spikes while maintaining 85%+ GPU compute saturation, infrastructure teams must execute a calibrated three-step configuration workflow.
Step 1: Enable Chunked Prefill to Decouple Prompt Execution
Without chunked prefill, a 4,000-token prompt arrival forces the GPU into a dedicated prefill kernel that consumes 100% of tensor core cycles for several hundred milliseconds. During this time, all concurrent decode streams stall, creating unacceptable Inter-Token Latency spikes. Enabling chunked prefill enforces a strict ceiling on the number of prompt tokens processed per iteration:
// Production vLLM engine startup configuration
python3 -m vllm.entrypoints.openai.api_server \
--model /models/Meta-Llama-3-70B-Instruct \
--tensor-parallel-size 8 \
--gpu-memory-utilization 0.93 \
--max-model-len 8192 \
--max-num-batched-tokens 2048 \
--max-num-seqs 256 \
--enable-chunked-prefill \
--disable-log-requests
Step 2: Balance Prefill and Decode Token Budgets
With chunked prefill enabled, the vLLM scheduler constructs each iteration batch using a priority-driven budget allocation algorithm:
- Prioritize Active Decode Steps: The scheduler first allocates token budget to all active request sequences in the decode phase (1 token per sequence). For example, if 100 sequences are actively decoding, 100 tokens are reserved.
- Fill Remaining Budget with Prefill Chunks: The remaining budget (e.g.,
2048 - 100 = 1948tokens) is allocated to incoming prompt prefill chunks. If a new request contains a 3,000-token prompt, it is chunked into an initial 1,948-token chunk in step 1, with the remaining 1,052 tokens processed in step 2. - Prevent Queue Starvation: By interleaving prefill chunks with decode steps, tensor cores remain saturated with compute while active user sessions experience uninterrupted sub-40ms Inter-Token Latency.
Step 3: Configure Request Admission and Priority Queuing
When burst traffic exceeds available KV cache blocks, vLLM's request admission controller must prevent memory thrashing. Configure the admission policy to reject or queue excess requests at the API gateway rather than allowing GPU memory overcommit. When available KV cache blocks drop below a 5% safety margin, the scheduler holds incoming prefill requests in an external queue until running requests complete and free their memory blocks.
Verification and Benchmarking: Stress Testing TTFT and Token Generation SLAs
Validation requires benchmarking the configured vLLM cluster against synthetic traffic profiles that mimic production user behavior.
Running Multi-Concurrence Benchmark Sweeps
Use vLLM's distributed benchmark_serving.py tool to simulate Poisson arrival distributions across ramping concurrency levels:
// Benchmarking continuous batching performance under 25 QPS load
python3 /vllm/benchmarks/benchmark_serving.py \
--backend vllm \
--model /models/Meta-Llama-3-70B-Instruct \
--dataset-name sharegpt \
--dataset-path /data/ShareGPT_V3_unfiltered_cleaned_split.json \
--num-prompts 1000 \
--request-rate 25.0 \
--save-result \
--result-dir /benchmarks/results/
Production Telemetry Metrics to Monitor in Prometheus
- vllm:time_to_first_token_seconds (P99): Under a calibrated chunked prefill budget of 2048 tokens, P99 TTFT must remain below 350ms across prompt lengths up to 4,000 tokens.
- vllm:time_per_output_token_seconds (P99 ITL): Inter-token generation latency must exhibit less than 10% variance, confirming that prompt prefill chunks are not causing decode pipeline bubbles.
- vllm:gpu_cache_usage_factor: Average KV cache utilization should hover between 75% and 85%, confirming high memory efficiency without triggering emergency request preemption.
- vllm:num_requests_waiting: Queue depth must drop to zero during steady-state traffic, signaling that admission throughput matches incoming query velocity.
Frequently Asked Questions
What is the primary cause of TTFT tail latency spikes in continuous batching?
TTFT spikes occur when large prompt prefills preempt active decode batches, causing memory bus saturation and queue head-of-line delays.
How does OneSource Cloud optimize infrastructure for low-latency vLLM deployments?
OneSource Cloud provides unvirtualized bare-metal GPU instances with PCIe Gen5 host-to-device interconnects and dedicated NUMA pinning, eliminating hypervisor scheduling jitter.