In the hope to find more information here, I’m crossposting from SO: Docker Swarm mode running many services with healthcheck eventhough replicas=1 - Stack Overflow
I have a single node with Docker in Swarm mode. I deploy a stack with a service with this config:
deploy:
mode: replicated
replicas: 1
update_config:
parallelism: 1
order: start-first
I hoped it deploys an instance first, before taking down the old one. But to make it only remove the old one when the new one is ready to receive traffic I add a healthcheck. Then instead of one new starting container, suddenly I get more and more starting containers for the service at the same time and the server is almost breaking under the load. Why are there so many instances when I only enable a healthcheck?
Also: setting mode to global suffers from the same issue with healthcheck.
Note that might be relevant: I use a 2nd compose file via -f to add some env variables. Does this mess things up?