Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Docker Swarm can keep a new task in Pending even when a running container uses almost no memory because the scheduler evaluates configured resource reservations—not just current usage reported by docker stats. In one single-node lab reported by Praneeth Kodumangulla, a running service used about 480 KiB, but the combined reservations for it and a second service exceeded the node’s memory capacity.

Why can Swarm report insufficient resources when memory use is low?

Runtime usage and reserved capacity answer different questions. docker stats shows current container consumption. A service’s reservation declares how much CPU or memory the scheduler must be able to allocate when placing a task. Docker documents that if no available node can satisfy a service’s reservation, the service remains pending. Docker’s Swarm service documentation describes services as declarative and explains that resource requirements influence placement.

As Docker puts it in its documentation, “If no available nodes can satisfy the requirement (for instance, if you request 4 CPUs and no node in the swarm has 4 CPUs), the service remains in a pending state until an appropriate node is available to run its tasks.” A low current memory reading does not make a reservation disappear or prove that another task can be scheduled.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What happened in the 480 KiB lab?

In an August 27, 2026 article, Praneeth Kodumangulla described a disposable, single-node Swarm lab with 4 CPUs and 5.772 GiB of memory. The reported Docker client version was 29.4.3 and the server version was 29.2.1. The figures below are the author’s reported measurements; they are not an independently reproduced test or a general Docker benchmark. Read the lab report.

Lab configuration Reported reservation or result
Service A Reserved 60% of node memory, reported as 3.463 GiB; runtime stats showed approximately 480 KiB used, 0.01% of node memory, and 0.00% CPU.
Service B added with a 50% reservation The reservations totaled about 6.349 GiB, or 110% of the reported node capacity. Its task remained pending, with no suitable node (insufficient resources on 1 node) shown by docker service ps.
Service B reservation reduced to 20% The reported combined total became 80%, about 4.617 GiB. The author says both services then ran, with each container still around 480 KiB at runtime.

The mismatch is the point: the first service’s small live footprint did not offset the amount of memory already reserved for scheduling. In that specific lab, changing the second reservation made the requested total fit the node’s reported capacity.

How do you diagnose a Swarm task stuck in Pending?

  1. Read the task’s full error. Run docker service ps --no-trunc <service> and inspect the task state and error message. The insufficient-resources message is a clue to check scheduler requirements, not a reason to assume current memory use is the cause.
  2. Compare reservations with eligible node capacity. Review the service’s configured CPU and memory reservations and the resources available on nodes that could run it. A node excluded by placement rules is not an option for that task, even if it appears capable at a glance.
  3. Check node state and placement conditions. Confirm that candidate nodes are available and that placement constraints or preferences do not rule them out. Docker identifies resource requirements, node availability, and placement conditions as factors in service placement.
  4. Consider other pending causes. Reservations are not the only explanation: Docker notes that image availability or other conditions can also leave a service pending. Use the task’s full status and error rather than treating every pending task as a memory-reservation failure.

Should you lower the reservation or add capacity?

First decide whether the declared reservation reflects the workload’s real resource needs and required headroom. The lab demonstrates that reducing a reservation can resolve an over-capacity scheduling condition without adding a node or memory; it does not establish that lowering reservations is safe sizing practice for production.

Rank #2
Synology DS225+ Private Cloud Media Server - Stream, Back Up Photos & Share Files, Intel CPU for Hardware Transcoding (2-Bay Diskless NAS)
  • Your Personal Streaming Server - Build your own Netflix-style media library and stream 4K movies, shows and photos to any device without monthly fees
  • Create Your Own Cloud - Store your entire photo, video and music collection; access from anywhere with fast 282 MB/s transfer speeds
  • Creator-Grade Backup Solution - Protect your irreplaceable content with automated backups to cloud services, external drives and remote NAS
  • Multi-Layered Data Protection - Combine RAID redundancy, automated backups and snapshot technology to prevent data loss from any cause
  • Smart Home Surveillance - Support up to 30 IP cameras with AI detection, instant alerts and secure remote monitoring
  • If the reservation is higher than the workload genuinely needs, revise it based on an appropriate sizing decision, then verify that the task schedules and that the workload still has adequate resources.
  • If the reservation is justified, an eligible node with sufficient capacity or an appropriate workload change may be necessary. Adding hardware alone is not a direct fix for a reservation mismatch unless the new capacity becomes available to eligible tasks.
  • If a capable node is excluded, review node state and placement constraints before changing the reservation.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What does this imply for autoscaling?

A possible operational mismatch arises when Swarm schedules against configured reservations while an external autoscaler reacts to host utilization: low observed use may not correspond to spare schedulable capacity under the reservations. Kodumangulla’s lab did not implement or benchmark an autoscaler, so it does not establish how any particular autoscaler, threshold, or scale-out policy would behave.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.