Docker swarm is not supporting to run more than 124 services of same stack file

I have a stack file for 168 services. If I deploy the stack file in swarm mode (docker stack deploy ), only 124 services are running and remaining are not.

Is there any limit for services in a stack file.

Edit: The services that which are not running are showing current status as NEW about an hour ago.

This has the smell of a too small network…
Keep in mind that every container, by default, gets a network interface into the docker_gwbridge network. (not visible in docker container inspect ...)

Also if you have a network defined in your stack where all your services take part, then each service will probably occupy two IP addresses. One IP for the container itself, and one IP for the dockerswarm builtin service load balancer.

You can check the size of docker_gwbridge via docker network inspect docker_gwbridge .
The IPAM.Config.[].Subnet should be larger than a mere /24 … I would suggest a /16 network.

Same goes for the network that you define for your stack. Make sure it is large enough to hold all your services and the replicas of your services.

BTW: The default network sizes are defined in your /etc/docker/daemon.json

Good luck
-h

1 Like