3.3

Keep long prompts from stalling short ones

The batch token budget trades the first-token time against the gaps between tokens, so set it for the latency you promise.

Long prompts arrive and short requests stall behind them. When you finish this section, you can choose a batch token budget for your latency target.

Our result: on our DGX Spark at low load, a budget of 16,384 tokens raised the P99 ITL from 574 to 798 ms.

Know the budget

vLLM always splits long prompts into chunks. In each step, the running streams get their next token first, and a waiting prompt fills the rest of the budget. --max-num-batched-tokens sets the budget. The token budget page explains the order.

A larger budget lets a long prompt finish its prefill in fewer steps, so its first token comes sooner. But each of those steps takes longer, and every running stream waits for it. So at low load, a larger budget can give a faster first token and longer gaps between tokens.

Know your default

vLLM sets the budget and the cap on running requests from the GPU memory that it reads. The defaults also differ between vllm serve and the offline LLM class. Other manual pages link to this table.

GPU memory that vLLM readsBudget, vllm serveBudget, LLM class--max-num-seqs, both
160 GiB or more16,38416,3841,024
70 GiB or more, but not an A1008,19216,3841,024
less, or unknown2,0488,192256

Our DGX Spark has 121.69 GiB of memory that the CPU and the GPU share. Its startup log still shows a budget of 2,048, the value for a small or unknown GPU. Read the value that your server uses before you change it. The 0.31.0 log does not print the budget under its own name. Find compile_ranges_endpoints in the engine config line. The largest number in that list is the budget.

See what our runs show

We measured budgets of 2,048 and 16,384 tokens on our DGX Spark with Qwen3-30B-A3B on 2026-10-21. The prompts had 1,024 to 4,096 tokens, and each request asked for 64 to 256 tokens. We sent requests at a fixed rate, with three seeds per point. Raw runs

Fig. 3.4a larger token budget at low loadchart
A larger token budget at 0.5 requests per second on the DGX Spark vLLM with Qwen3-30B-A3B on an NVIDIA GB10, prompts of 1,024 to 4,096 tokens, 64 to 256 output tokens, 0.5 requests per second, three seeds. With a budget of 2,048 tokens, the median first token took 1,145 ms and the P99 ITL was 574 ms. With 16,384 tokens, the first token took 906 ms and the P99 ITL was 798 ms. median first token, ms 0 750 1,500 1,145 2,048 906 16,384 P99 ITL, ms 0 500 1,000 574 2,048 798 16,384 Lower is better on both. Bars are labelled by --max-num-batched-tokens.
At 0.5 requests per second, a budget of 16,384 tokens raised the P99 ITL from 574 to 798 ms. Each bar is the median of three seeds. The first-token times of the two budgets overlapped across seeds.
Requests per secondBudgetMedian TTFTMedian TPOTP99 ITL
0.52,0481,145 ms149.3 ms574 ms
0.516,384906 ms139.4 ms798 ms
12,048454 ms156.5 ms405 ms
116,384477 ms156.9 ms395 ms
22,048560 ms205.5 ms587 ms
216,384595 ms205.1 ms586 ms

At 0.5 requests per second, the larger budget raised the P99 ITL by 39 percent, and the seed ranges did not overlap. The first token came sooner, but the seed ranges of the first token overlapped. So the cost is clear, and the gain is not confirmed.

The median first token at 0.5 requests per second was slower than at 1 request per second, for both budgets. With the 2,048 budget, all three seeds at 0.5 were above 900 ms. All three at 1 were below 600 ms. So one slow seed does not explain it. We did not find the cause.

At 1 and 2 requests per second, the two budgets gave the same numbers within the seed ranges. At those rates, more requests share each step, so a single long prompt fills less of the budget.

Read our result as narrow: two budgets, three low rates, one model, and one machine. The 2026 paper "P-PAS: Prefill-Pressure Adaptive Scheduling for Long-Context LLM Serving" found that no single fixed budget in vLLM was best at every load. A large budget gave lower latency at low pressure. A small budget won when several prefills competed with running streams. We did not measure that crossover ourselves.

The run with no budget flag matched the run with 2,048 at every rate. That agrees with the 2,048 in the startup log. All runs held a median clock of 2,398 to 2,411 MHz.

Tune it

  1. Read the budget that your server uses.
  2. If the P99 ITL is too high and long prompts arrive, lower the budget. Try 2,048 if your default is larger.
  3. If the first token of long prompts is too slow and the P99 ITL has room, raise it.
  4. Measure at your real request rate, because the effect changed with the rate in our runs.
  5. Measure again when your load changes, because the best budget moves with the load.

vLLM also has --long-prefill-token-threshold. It caps the tokens that one long prompt gets in a step when other requests wait. It is off by default, and we did not test it.

vLLM 0.31.0 · db9527a · 2026-10-05 · Edition 2026.10