Prefill is compute-bound and bursty; decode is memory-bound and steady. Running both on the same GPUs means they interfere: a long prompt arriving stalls every stream in the batch, and you cannot tune for time to first token and for streaming speed separately. Disaggregated serving puts them on different GPU pools and moves the KV cache between them. This lesson explains how it works, what the KV transfer costs, how to size the two pools, how vLLM, SGLang and Dynamo implement it, and the cases where it does not pay off.
- Explain the interference problem that disaggregation solves
- Trace a request through prefill pool, KV transfer and decode pool
- Estimate KV transfer size and time for a link
- Size prefill and decode pools from workload shape
- Decide when aggregated serving with chunked prefill is the better choice
The interference problem
In an aggregated server, every scheduler step mixes decode tokens for running requests with prefill work for new ones. When an 8,000-token prompt arrives, its prefill takes a long, compute-heavy chunk of time, and every request in the batch waits for its next token. Chunked prefill softens this by slicing long prompts, but the two phases still share one GPU and one set of tuning knobs: batch sizes that favour decode throughput hurt TTFT, and vice versa.
Disaggregated serving separates them. A prefill pool of GPUs only runs prefills; a decode pool only runs decode. Each pool gets the batch sizes, parallelism and even GPU type that suit its phase. vLLM's documentation states the two benefits plainly: tune TTFT and inter-token latency separately, and control tail inter-token latency. It also states that disaggregation by itself does not improve throughput; the gain is in meeting both latency targets at once, which can improve goodput.
How a request flows
- A router or gateway receives the request and picks a prefill worker, ideally one that already caches the prompt's prefix.
- The prefill worker computes the KV cache for the prompt and the first output token.
- The KV cache is transferred to a chosen decode worker, over NVLink inside a node or RDMA between nodes, using a transfer library such as NIXL or Mooncake.
- The decode worker continues generation from that cache and streams tokens to the client.
- Both workers free or keep the cache according to their caching policy.
python -m sglang.launch_server --model-path "$MODEL_ID" \
--disaggregation-mode prefill --port 30000 \
--disaggregation-ib-device mlx5_roce0
python -m sglang.launch_server --model-path "$MODEL_ID" \
--disaggregation-mode decode --port 30001 --base-gpu-id 1 \
--disaggregation-ib-device mlx5_roce0
python -m sglang_router.launch_router --pd-disaggregation \
--prefill http://127.0.0.1:30000 --decode http://127.0.0.1:30001 --port 8000vLLM implements the same pattern through KV connectors set with --kv-transfer-config (NIXL, LMCache, Mooncake and others) and marks the feature experimental. NVIDIA Dynamo wraps vLLM, SGLang or TensorRT-LLM workers with --disaggregation-mode prefill|decode and adds KV-aware routing and automatic pool scaling, as covered in the open-source track.
The cost: moving the KV cache
4,000-token prompt x 128 KiB/token = 500 MiB to move per request
at ~50 GB/s (fast RDMA or NVLink path) -> ~10 ms
at ~1.25 GB/s (10 Gb Ethernet) -> ~420 msThe transfer adds directly to time to first token unless it overlaps with computation (engines stream layers as they finish). On a fast fabric it is a small price for removing interference; on ordinary Ethernet it can cost more than the prefill itself. Disaggregation therefore assumes high-bandwidth, RDMA-capable links between pools, and it favours models with compact caches (grouped-query attention, FP8 cache).
If your prompts are short, your decode batches small, or your network slow, disaggregation mostly adds complexity and transfer latency. Aggregated serving with chunked prefill and KV-aware routing is often the better answer. Measure both before committing.
Sizing the two pools
Deployments are often described as xPyD: x prefill workers, y decode workers. The right ratio comes from the workload. Prefill load scales with input tokens per second; decode load scales with concurrent sequences and output tokens per second. A RAG service with long prompts and short answers needs relatively more prefill capacity; a writing assistant with short prompts and long answers needs more decode capacity.
- Measure one prefill worker's input-token throughput at your TTFT target, and one decode worker's sequence capacity at your ITL target.
- Divide expected peak input tokens per second by the first, and peak concurrent sequences by the second, to get starting values for x and y.
- Let an autoscaler adjust each pool independently; that independence is one of the main operational gains. Dynamo's Planner does exactly this against TTFT and ITL targets.
- Watch both pools' queues: a growing prefill queue raises TTFT; a full decode pool blocks KV handoffs.