Docker Swarm Rejects Task Despite 0.01% Memory Use — Reservations Are Why
A developer discovered that Docker Swarm refused to schedule a new service due to 'insufficient resources,' even though the existing service was consuming only 480 KiB of memory on a 5.772 GiB node. The confusion stemmed from the difference between runtime memory usage and scheduler reservations: Swarm makes placement decisions based on declared --reserve-memory values, not actual consumption. In the test setup, Service A held a 3.463 GiB reservation (60% of node memory), and adding Service B with a 50% reservation pushed the combined total to roughly 6.349 GiB — exceeding node capacity. Reducing Service B's reservation from 50% to 20% brought the combined total to 4.617 GiB, and Swarm immediately scheduled the task successfully. The experiment highlights that --reserve-memory controls scheduling eligibility, while --limit-memory is the correct flag for enforcing actual runtime memory caps.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in