nginx load balancing

January 24, 2013 4.4k views
Was reading over the nginx load balancing tutorial. And was just wondering, say I have 3 VPS's and they are all serving pages. and I wanted to load balance the 3. Would I have to get another VPS to act as the controller/load balancer itself? Or can I throw nginx on one of those original 3 vps's. And use that 1, to do both load balancing and serve pages?
6 Answers
You can use one droplet as a load balancer and a webserver, just add localhost to the upstream list. Bear in mind that having a separate load balancer is much more efficient.
You would want to definitely split that off onto a separate virtual server.

It will keep your configurations cleaner and you can make each of the web servers either managed through puppet with a base config or through a snapshot inside of the control panel.

You want to segment services as much as possible and then size them appropriately since the work loads between them are so vastly different you will receive much more efficiency.

For example splitting apart your web servers from your DB, and separating out your cache, allows better utilization of each because the underlying server is performing only function instead of switching back and forth.
Is there any recommendations what kind of droplet should be the load balancer vs. the web server ?
@marko.korhonen: You can choose any kind of droplet you want, whatever you prefer :]
What should the size of a load balancer be? Is there a 'rule of thumb' or best practice you should use when selecting specs for the load balancer?
Have another answer? Share your knowledge.