How Swarm manger choose Worker Node

Hello There,

I am curious to know about the way Swarm manger choose Worker Node for assigning a task. Here is my use case,

Number of Swarm Managers - 3

Number of Worker Nodes - 3

Swarm Mode - Global

With the above setup we have an application container deployed in all 3 workers. We access the applications via Haproxy (webserver) with RoundRobin.


Let’s assume workers 1 and 2 are super busy handling the existing requests and 3 is idle:

  1. If we have all 3 Swarm Managers as Haproxy backends, Swarm manager has intelligence to send request to the worker which is idel/not busy? OR Swarm Manager also simply follows RoundRobin?

  2. If “Swarm Manager also simply follows RoundRobin” why don’t we have 3 worker nodes directly configured as Haproxy backend?

what is the efficient way to do it? having Swarm Managers as Haproxy backend or Workers as Haproxy backend?

i hope this may help :slight_smile:

Thanks a lot for sharing. No one can explain raft better than this.

However, it didn’t address my question. My question is about communication between Swarm Manager and Worker Nodes (not within Master election process).