Gibbs
Gibbs

Reputation: 22974

Docker swarm load balancing

Do we need to balance load via ngnix with swarm mode?

If so, why do we need to do that. Docker swarm balances load. I tested for simple application. It has several strategies for load balancing.

Even docker swarm balances load, why are there so many articles about load balancing with ngnix in swarm mode?

Upvotes: 3

Views: 950

Answers (2)

Markus
Markus

Reputation: 3158

Do we need to balance load via ngnix with swarm mode?

Yes and no. It depends ... :)
Application load balancing is doing the swarm for you. E.g. when deploying a service with a replica of 10, the swarm mode will perform a round robin load balancing around your 10 applications everytime you call it. It doen't matter which manager or worker you're calling.

But on host level, you need an external classic load balancer. E.g. when your swarm runs on 4 digital ocean machines, you need a load balancer which covers all 4 ip adresses.

Even docker swarm balances load, why are there so many articles about load balancing with ngnix in swarm mode?

a) Because nginx wants to earn money
b) Because there was a time before docker swarm mode exists and where everything was complicated
c) Because it's still good to know how to do it yourself d) Because you're very familar with nginx

Upvotes: 6

N00b Pr0grammer
N00b Pr0grammer

Reputation: 4647

The new feature in Docker 1.12 make Swarm a powerful platform, but this will be enhanced by taking advantage of open source NGINX and even more by using NGINX Plus. The ability of NGINX Plus to dynamically reconfigure the back-end containers to load balance using DNS, and the visibility provided by the Status API, make for a very powerful container solution.

There is this article which is very descriptive in explaining why is this so advantageous. Link here.

Hope this answers your question!

Upvotes: 1

Related Questions