Loadbalancer Musings

So recently I have been thinking about getting a load balancer/service, but worried about it being a single point of failure, as well as a hefty price. So how about a setup where we have multiple frontend webservers which are all setup to be a load balancer for each other?

Something like the following would be configured in DNS:

This would round robin the requests to any of the available frontend web servers.

In the Nginx configuration for each we would then load balance as well (including itself), this would automatically detect if a web server was unavailable and try another:

When I tested this with some VM’s it has worked flawlessly. Any thoughts or further improvements that could be made?

About Louis

Louis is a Developer and all round geek from the UK with a keen interest in web technologies and mobile applications. When not playing with code, he is probably rebuilding a Linux server or watching a Netflix marathon!
This entry was posted in Computing, Debian, General, Linux. Bookmark the permalink.

2 Responses to Loadbalancer Musings

  1. Username says:

    Your configuration should be modified. It could not work the way it’s currently posted:

    server_name example.com; # missing underscore
    location / {
    proxy_pass http://webservers; # proxy_pass needs a location block.

Leave a Reply