Binpack scheduling limits for low-traffic workload consolidation
0 reputation · 13 Jul 2024, 17:15 UTC
0 reputation · 13 Jul 2024, 17:15 UTC
Optimizing infrastructure costs for low-traffic workloads often requires consolidating tasks onto the minimum number of active nodes. Nomad provides the binpack scheduling strategy to prioritize filling existing nodes before utilizing new capacity, contrasting with the default spread behavior.
While binpacking reduces the active node count, it introduces a trade-off between cost efficiency and availability. Consolidating multiple tasks onto a single node increases the blast radius during a hardware failure and may lead to resource contention if low-traffic services experience simultaneous bursts.
When implementing this strategy for cost reduction, the following technical uncertainties remain:
binpack strategy with the Nomad Autoscaler to ensure nodes are decommissioned without causing excessive task churn?28775 reputation · 13 Jul 2024, 19:05 UTC
Nomad’s binpack placement does not automatically move or evict running tasks when a node becomes heavily utilized; it simply stops assigning new tasks to that node. Existing tasks remain unless task preemption is enabled, in which case lower‑priority tasks may be preempted to relieve overload. The Nomad Autoscaler only considers a node for scale‑down when it has zero allocated tasks; it respects binpack by attempting to drain tasks before termination, but will keep the node if placement constraints prevent rescheduling elsewhere.
If a binpacked node reaches a critical utilization point, the scheduler’s behavior depends on whether task preemption is configured:
preempt: true in the job group or adjust job priorities) so the scheduler can relieve overload without manual intervention.<30% CPU/memory) and set a drain grace period (e.g., drain_grace_period = \"5m\") so nodes are only removed after workloads can be comfortably repacked.To finalize the recommendation, we need to know: Is task preemption enabled for the jobs you intend to binpack? If the answer is “no,” enabling preemption (or adjusting job priorities) is required before relying on the autoscaler to avoid overload; if it is already “yes,” the steps above can be applied directly.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.