12/34
Part 3 of 5 · PlacementLearn and do

Placement: decide where the job runs

Pack by default, and spread only what needs it

Spreading puts each job on the least-loaded node that fits. It lowers interference between jobs, and one bad node hurts fewer of them.

Packing puts each job on the fullest node that still fits. It keeps whole nodes empty for big jobs, and it lets the autoscaler remove nodes that sit idle.

Netflix has written about both sides. In 2016 it said bin packing frees as many machines as possible, so the cluster can shrink by ending idle machines without ending running tasks. In 2026, about Titus, it wrote that spreading fights bin-packing. A host kept partly empty to honor an anti-affinity rule, one that keeps certain pods apart, can't be filled by a workload that would have fit there.

For a GPU cluster that runs gang jobs, pack by default. A gang job needs all of its workers running at the same time, as distributed training does. Spread only the workloads that need it, such as inference replicas.

The editor holds spread(free, gpus) and a buggy pack(free, gpus), and each returns the index of a node. FREE lists the free GPUs on four nodes, and pack picks the wrong one for a 1-GPU job.