DEV Community

Qaiser Mehdi
Qaiser Mehdi

Posted on Edited on

Two long prompts at once dropped my streamed answer to 1 token per second (vLLM, measured)

Update, 27 Nov: a 6-setting follow-up sweep confirmed the one-token-per-step count, and found one correction. With prefix caching on, this model cuts prompt chunks to multiples of 1,568 tokens, so the 4096 run with caching on really used ~3,136-token chunks. That is why it was faster (1.08) than caching off (0.73). The "about 18 steps of 1.3 s" below fits the caching-off run. Sweep data: https://github.com/qaisermehdi3-coder/qvunex/tree/main/benchmarks/data/lpsweep-5090-2026-11-26
There is an open vLLM issue, #54919. An answer that is already streaming almost stops while a second long prompt is read. One person reproduced it on an RTX 4080 SUPER with a hybrid Qwen model. I rented an RTX 5090 and ran the same model and flags three times, changing one thing each time.

Short version: it happens on the 5090 too. Prefix caching is not the cause here. The token budget is the knob, and a smaller budget made it about 3 times better, for about 4 seconds of extra wait on the long prompts.

The setup

  • RTX 5090 32 GB on vast.ai, $0.505/hour (Ryzen 7 7800X3D host)
  • vLLM 0.27.1, model cyankiwi/Qwen3.8-27B-AWQ-INT4, no MTP
  • Flags from the issue: --max-model-len 200000 --max-num-seqs 3 --max-num-batched-tokens 4096 --gpu-memory-utilization 0.95 --kv-cache-dtype fp8 --enable-prefix-caching
  • Two prompts sent together: A with about 60,000 tokens, B with about 75,000. Both answers 1,024 tokens, streamed

A gets its first token first. Then it streams while B's prompt is still being read. That window is what I measured.

The three runs

Speed of A's answer while B was being read:

  • Budget 4096, prefix caching on: 1.08 tokens per second, longest pause 1.30 s
  • Budget 4096, prefix caching off: 0.73 tokens per second, longest pause 1.80 s
  • Budget 1024, prefix caching on: 3.23 tokens per second, longest pause 0.42 s

Once B got its first token, both answers went back to about 60 tokens per second. With short prompts the same server did about 72.

First token of the long prompts:

  • A: 20.6 s / 20.5 s / 24.6 s
  • B: 44.8 s / 45.1 s / 48.4 s

Why 1 token per second

The numbers fit a simple count. vLLM reads a long prompt in chunks. Each engine step takes one chunk of B's prompt, up to the budget, plus one token for A. So A gets one token per step.

With a budget of 4096, B's 75,000 tokens take about 18 steps. Those took about 24 seconds, so about 1.3 seconds per step. That is 1 token per second for A.

After runs 1 and 2, I used this count to predict run 3. A budget of 1024 means about 73 steps in the same time, about 0.33 seconds each. So A should get 3 to 4 tokens per second. It got 3.23.

The trade-off

A smaller budget means A keeps streaming while B is read. The longest pause went from 1.3 s to 0.4 s. But each long prompt got its first token about 4 seconds later: +19% for A, +8% for B.

Which one is better depends on your traffic. If users watch answers stream while agents send long prompts, the smaller budget looks better. If the long prompts are the users waiting, maybe not.

What I don't know

  • One run per setting, one pair of prompts, synthetic text
  • The issue reports minutes of this on 2-node DGX Spark. Mine is seconds. I don't know if the same count explains that case
  • Not tested: MTP, chat completions without ignore_eos, other models, SGLang

Files

The script is one file, longpair.sh. It runs on one rented GPU and writes a report. The three reports, every token's time, /metrics every 3 seconds and the server logs are here.

If you run it on another card, send me the report. I'll add it.

Top comments (0)