20.7.4 Disaggregated pools and failover
This part of Deploying LLMs on Kubernetes: GPUs, Replicas, and Rollouts develops the worked mechanisms below.
Concepts from other sections (16)
This section uses these ideas. Each has a short definition and a link to the section that explains it in full. Tap a dotted term in the text to preview it.
- failure domain: the set of replicas lost together in one failure (a node, a zone, a cluster); the fleet is sized so the replicas outside the largest one still meet peak load. Read more: 20.7.5 Adapter fleets and operations
- Worker pool: stateless processes that long-poll a durable queue, execute tasks, and report results; because all state lives in the queue or engine, workers can crash, deploy, and autoscale freely. Read more: Chapter 7: Durable Orchestration and Workers in Systems Engineering
- LeaderWorkerSet: a Kubernetes workload that creates, restarts, and scales a multi-pod replica as one unit. Read more: 20.7.5 Adapter fleets and operations
- TPOT (time per output token): time between successive tokens of a running request, about one step. Read more: 23.4 Chunked prefill (mixed prefill + decode batches)
- Service Level Objective (SLO): a target for a defined measure of service behavior over a specified window. Read more: Chapter 13: Engineering Acronyms in Software Engineering
- KV cache: the stored keys and values of all processed tokens, per layer, that let each new token attend without recomputation. Read more: Chapter 20: Inference Engines and GPU Deployment
- TTFT (time to first token): time from a request’s arrival to its first generated token. Read more: 23.4 Chunked prefill (mixed prefill + decode batches)
- Server-Sent Events (SSE): a
text/event-streambody ofdata: ...events, each terminated by a blank line. Read more: 23.1 Your first endpoint: a std-only Rust HTTP/1.1 + SSE server - commit rule: a request that fails before any byte reaches the client is retried elsewhere, and one that fails after is ended with an explicit error event. Read more: 20.7.5 Adapter fleets and operations
- cold start: the time from scheduling a replica to serving its first request, dominated by fetching and reading weight bytes and then by engine initialization. Read more: 20.3.4 Portability and load triage
- startup probe: a probe that holds off liveness checks until a slow-starting container is up; for model servers it covers the cold start. Read more: 20.7.5 Adapter fleets and operations
- device plugin: the node agent that advertises GPUs to Kubernetes as the integer extended resource
nvidia.com/gpu. Read more: 20.7.5 Adapter fleets and operations - readiness probe / liveness probe: checks that, on failure, remove a Pod from its Service or restart its container, respectively. Read more: 10.1 Tracer deploy: images, a kind cluster, two Helm charts, and Jaeger in Systems Engineering
- Network partition: a split that leaves some replicas unable to reach others. Read more: 12.13 A Raft partition (optional) in Systems Engineering
- Reserved capacity: a share of the engines guaranteed to a tenant regardless of others’ load. Read more: 12.10 A noisy neighbor in Systems Engineering
- StatefulSet: a workload controller that gives each Pod a stable name and its own persistent claim, with ordered rollout. Read more: 10.7 Durable and worker images and charts in Systems Engineering
Learning objectives
- Account for KV handoff, ownership, and failure domains across worker pools.
Disaggregated prefill and decode as two pools
Section titled “Disaggregated prefill and decode as two pools”Disaggregation becomes, on Kubernetes, two Deployments (or two LeaderWorkerSets) of the same model: a prefill pool started with the engine’s prefill role and a decode pool with the decode role, a KV connector between them (NIXL over RDMA), and a router that sends each request to a prefill worker, then a decode worker. The pools scale independently, which is the point: you size each for its own bottleneck.
Size them from first principles, using the worked chatbot (20 req/s, 2,000-token mean input of which 1,500 tokens are a cached system prompt, 300-token output, 70B FP8 on H100s):
- Prefill demand. Uncached input is tokens per second. Prefill costs about GFLOP per token. An H100 does about 990 TFLOPS of dense FP8 at 50% utilization, so one GPU prefills about tokens per second. That needs 1.4 GPUs: one TP=2 prefill instance.
- Decode demand. Output is tokens per second. On a TP=2 decode instance at batch 160, each step reads 35 GB of weights per GPU plus the batch’s KV ( KiB GB per GPU), about 65 GB at an effective 2.35 TB/s (70% of 3.35 TB/s), so a step takes about 28 ms and the instance produces tokens per second. That is just under the demand, so two decode instances, with headroom.
- The fleet. By throughput alone, one prefill instance and two decode instances: 6 GPUs, against 10 for the aggregated design. The 28 ms step also stays under the 50 ms TPOT SLO because no prefill ever enters a decode batch. Add the rules from later in this section, though (at least two instances per pool, and survive losing one) and the fleet becomes two prefill and three decode instances: losing a decode instance leaves tokens per second against 6,000. That is 10 GPUs, the same as aggregated. At this size disaggregation buys a steadier TPOT, not fewer GPUs; the GPU saving appears once the pools are large enough that the minimums stop dominating.
These are first-order numbers: they ignore communication time, attention compute, and the KV transfer itself, and they must be confirmed by load-testing each pool. But they show how to set the ratio, and why it moves with the traffic. If the shared prefix stops being cacheable, prefill demand quadruples and the prefill pool must grow while the decode pool stays the same, which an aggregated fleet cannot do without overbuying decode.
Running the two pools
Section titled “Running the two pools”On Kubernetes the two pools are two workloads (Deployments, or LeaderWorkerSets for multi-node instances) built from the same image and the same weights, started with different engine roles. In vLLM, the --kv-transfer-config JSON names a connector such as NIXL and sets kv_role to kv_producer for prefill or kv_consumer for decode; SGLang uses --disaggregation-mode prefill|decode. A disaggregation-aware router sits in front and makes the two-hop call, picking a prefill worker and a decode worker per request. llm-d and NVIDIA Dynamo package that router, and Routing, cascades, and failover builds one by hand; Disaggregated prefill and decode builds the engine side, including the KV hand-off.
Three Kubernetes concerns follow from the KV transfer:
- Placement. The KV cache crosses RDMA, so the prefill and decode pods must sit in the same network block, with the RDMA devices exposed to their containers, exactly as for a multi-node LeaderWorkerSet. Over TCP the transfer cost in Serving, Capacity & Load Testing erases the gain.
- Separate autoscaling signals. Scale the prefill pool on its waiting queue or on TTFT, and the decode pool on KV-cache usage and running sequences, which track TPOT. One ScaledObject per pool, each with its own threshold. The ratio between them moves with prompt length and the cache hit rate, as the review question at the end of this section shows; Dynamo’s planner rebalances it automatically.
- Minimum size. Each pool needs at least two instances on different nodes. A pool of one is a single point of failure for every request.
When a pool fails
Section titled “When a pool fails”Disaggregation turns one failure domain per request into two, and each failure lands at a different point in the request:
| Failure | Bytes sent to the client? | What the router does |
|---|---|---|
| Prefill pod dies before the hand-off | No | Retries on another prefill worker |
| KV transfer fails or times out | No | Releases the decode worker’s partial blocks and retries the whole request |
| Decode pod dies mid-stream | Yes | Ends the stream with an SSE error event (the commit rule, below) |
| The whole prefill pool is down | No | Every request fails; route to an aggregated fallback Deployment if you keep one |
Disaggregation pays at scale, with long prompts and strict TPOT, on an RDMA fabric. With a handful of replicas, short prompts, or no RDMA, one aggregated Deployment is simpler and has half the ways to fail.
Failure domains and failover
Section titled “Failure domains and failover”Every layer of the fleet fails: an engine process, a GPU, a node, a zone, a whole cluster. Kubernetes replaces a lost replica, but only after a full cold start, so the fleet must carry enough spare capacity to ride out the failures you choose to survive, and the router must keep in-flight requests from turning into wrong answers.
What fails and what Kubernetes does
Section titled “What fails and what Kubernetes does”| Failure | How it shows | What Kubernetes does on its own | What you add |
|---|---|---|---|
| Engine crash or OOM | Container exits | Restarts the container; the replica is out for one cold start | Headroom; a startup probe sized to the cold start |
| GPU fault (XID error, ECC error, GPU off the bus) | CUDA errors or a hung engine; the process may stay alive | The device plugin marks the GPU unhealthy so nothing new lands on it, but leaves the running pod alone | A liveness probe that exercises the engine; DCGM health checks; automation that cordons and drains a node with a failing GPU |
| Node lost (kernel panic, power, network partition) | Node goes NotReady after about 50 s without a heartbeat | Evicts its pods only after their unreachable toleration expires: 300 s by default | Shorter tolerationSeconds on serving pods; replicas spread across nodes |
| One pod of a LeaderWorkerSet group | The group can no longer serve | With the default RecreateGroupOnPodRestart policy, recreates the whole group | Count the group as one replica; its cold start is multi-node |
| Zone outage | Many nodes NotReady at once | The same, at scale; replacements need free GPUs in other zones | Spread across zones; reserved capacity in each |
| Cluster or region outage | Everything | Nothing | A second cluster behind a global gateway, or a fallback route to another provider |
The 300 s default matters most. Kubernetes adds a five-minute toleration for node.kubernetes.io/unreachable and node.kubernetes.io/not-ready to every pod, The node controller first waits about 50 s without a heartbeat before it marks the node unreachable. So a replica on a dead node is not replaced until nearly six minutes after the node stops, and then it pays its cold start. Shorten the toleration for serving pods, and spread replicas so one node never holds most of them. These fields go in the pod template, spec.template.spec of the Deployment:
spec: # the pod template: spec.template.spec in the Deployment tolerations: - { key: nvidia.com/gpu, operator: Exists, effect: NoSchedule } - { key: node.kubernetes.io/unreachable, operator: Exists, effect: NoExecute, tolerationSeconds: 30 } - { key: node.kubernetes.io/not-ready, operator: Exists, effect: NoExecute, tolerationSeconds: 30 } topologySpreadConstraints: - maxSkew: 1 topologyKey: kubernetes.io/hostname whenUnsatisfiable: DoNotSchedule labelSelector: { matchLabels: { app: llama-70b } } - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: ScheduleAnyway labelSelector: { matchLabels: { app: llama-70b } }A short toleration only starts the replacement sooner; the cold start still follows. It is the spare capacity that carries the traffic in between. The toleration has a cost too: 30 s on not-ready also evicts a healthy replica after a brief kubelet or network blip, and that replica then pays a multi-minute cold start. Pick the value against how often your nodes blip.
Pods with fixed names, which includes the StatefulSets inside a LeaderWorkerSet, can stay Terminating on a node that never comes back. Until the Node object is deleted, or tainted node.kubernetes.io/out-of-service, the group may not be recreated. Automate that step for nodes your cloud reports as gone.
Sizing for the failure you must survive
Section titled “Sizing for the failure you must survive”The rule is one inequality over the largest failure domain you have decided to survive:
Apply it to the worked fleet, 5 replicas at 6 req/s of goodput against a 20 req/s peak:
- Losing one replica: . The fleet survives, running hotter until the replacement is ready.
- Losing a node: with bin-packing, node 1 holds four of the five replicas, and losing it leaves req/s. Packing to fill nodes made one node 80% of the fleet. Even the default three-and-two spread leaves req/s after losing the larger node.
- Surviving any one node: four replicas must remain after the largest node goes, since . On three dedicated nodes, two replicas each does it: 6 replicas and 12 GPUs, and losing a node leaves req/s. That is 20% more GPUs than the 10-GPU fleet. Spreading one replica per node across five nodes also works on 10 GPUs, if those nodes are shared with other workloads. Either way, the GPUs left free on the serving nodes can host other models or batch work that yields to serving.
Surviving a zone is the same calculation with zones as the domain. Decide the domain explicitly: one replica is nearly free, one node usually costs a node, and one zone costs a zone’s worth of reserved GPUs.
The request in flight
Section titled “The request in flight”Spare capacity protects the requests that arrive after a failure. The ones already running on a dead pod follow the commit rule, which the gateway chapter calls the commitment boundary. If no byte has reached the client, the router retries on another replica, and the client sees only a slower first token. Once bytes have streamed, the stream ends with an SSE error event, because no other replica holds that sequence’s KV cache. A decode worker dies mid-stream in Systems Engineering explains why splicing or silently closing the stream is worse, and runs this failure as a drill.
Review questions
Section titled “Review questions”-
Why does retrying a partially streamed generation require an explicit contract?
Answer
The original KV and RNG state may be gone, so a restart can produce different output and cannot silently promise continuation.