# Question about --enable-chunked-prefill and --max-num-batched-tokens

**URL:** <https://discuss.vllm.ai/t/question-about-enable-chunked-prefill-and-max-num-batched-tokens/3039>\
**Category:** General\
**Created:** [October 8, 2026, 10:10am UTC](https://discuss.vllm.ai/t/question-about-enable-chunked-prefill-and-max-num-batched-tokens/3039 "2026-10-08T10:10:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pigcanflysohigh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/pigcanflysohigh/32/702_2.png) [@Pigcanflysohigh](https://discuss.vllm.ai/u/Pigcanflysohigh)\
**Post date:** [October 8, 2026, 10:10am UTC](https://discuss.vllm.ai/t/question-about-enable-chunked-prefill-and-max-num-batched-tokens/3039/1 "2026-10-08T10:10:46Z")

</div>

What is the functions of --enable-chunked-prefill and --max-num-batched-tokens? make inferen faster or something else？

---

<div class="post-metadata">

**Author:** ![RunLLM](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/runllm/32/233_2.png) [@RunLLM](https://discuss.vllm.ai/u/RunLLM)\
**Post date:** [October 8, 2026, 10:11am UTC](https://discuss.vllm.ai/t/question-about-enable-chunked-prefill-and-max-num-batched-tokens/3039/2 "2026-10-08T10:11:00Z")

</div>

`--enable-chunked-prefill` allows vLLM to split large prompt (prefill) requests into smaller chunks, batching them with decode requests. This improves GPU utilization and can increase throughput, especially under high concurrency, by overlapping compute-bound (prefill) and memory-bound (decode) operations. `--max-num-batched-tokens` sets the maximum number of tokens processed in a single batch, directly affecting batching efficiency, throughput, and latency. Tuning this value helps balance inter-token latency (ITL) and time to first token (TTFT) for optimal performance.

In summary, both options are for performance tuning: chunked prefill improves batching and resource utilization, while max-num-batched-tokens controls batch size for better throughput or latency, depending on your workload and hardware. For details and tuning recommendations, see [Performance Tuning with Chunked Prefill](https://docs.vllm.ai/en/latest/configuration/optimization/#performance-tuning-with-chunked-prefill) and [Optimization](https://github.com/vllm-project/vllm/blob/main/docs/configuration/optimization.md). Would you like more detail or code examples?

Sources:

- [Performance Tuning with Chunked Prefill](https://docs.vllm.ai/en/latest/configuration/optimization/#performance-tuning-with-chunked-prefill)
- [Optimization](https://github.com/vllm-project/vllm/blob/main/docs/configuration/optimization.md)

Hint: Mention @Herald in the post for followups.

---

<div class="post-metadata">

**Author:** ![Pigcanflysohigh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/pigcanflysohigh/32/702_2.png) [@Pigcanflysohigh](https://discuss.vllm.ai/u/Pigcanflysohigh)\
**Post date:** [October 8, 2026, 10:14am UTC](https://discuss.vllm.ai/t/question-about-enable-chunked-prefill-and-max-num-batched-tokens/3039/3 "2026-10-08T10:14:03Z")

</div>

我的业务场景是用模型研判流量日志中是否存在威胁，流量日志加Agent上的工作流prompt，会涉及到很长的上下文。这种场景下，这两个参数有什么必要性的帮助？
