3

In docker swarm mode (docker engine 1.12+), for the service, what is the load balancing algorithm?

Is it pluginable?

Assuming it is round-robin, is it still needed for a high level load balancer? Since whatever routing algorithm the high level load balancer is using, the load will go to each node evenly.

benjah1
  • 1,440
  • 1
  • 13
  • 17

1 Answers1

4

The algorithm is currently round-robin and I've seen no indication that it's pluginable yet. A higher level load balancer would allow swarm nodes to be taken down for maintenance, but any sticky sessions or other routing features will be undone by the round-robin algorithm in swarm mode.

BMitch
  • 231,797
  • 42
  • 475
  • 450
  • So, if we have higher level load balancer(haproxy, etc), it is good to disable load balancing at swarm node, since it may interfere with the how load balancing is being done. And if we disable it, we need to handle the port mappings, etc by ourself – SunilS Jun 20 '17 at 12:24
  • @user1768610 There's no need to add additional load balancing before hitting the swarm mode port for load balancing purposes. However, I'd added layers before the service to give a single port to access all services (traefik) and I've used external load balancers like an F5 to automatically handle a failed docker node. – BMitch Jun 20 '17 at 13:50