Is it possible to set up non-round robin DNS load balancing?

May 23, 2014 2.9k views
Is it possible to set up non-round robin DNS load balancing? Desired functionality: *Note Server A is a clone of Server B Scenario 1 - No fault : [Incoming request] -> [DigitalOcean DNS ] -> [Server A responding] Scenario 2 - Server A Fault: [Incoming request] -> [DigitalOcean DNS] -> [Server A NOT responding] -> [Server B responds] Scenario 3 - Server A & Server B Fault [Me] -> [Bar] -> [Beer] *Note, yes I read this: https://www.digitalocean.com/community/articles/how-to-configure-dns-round-robin-load-balancing-for-high-availability And the load balancing section here: https://www.digitalocean.com/community/articles/dns-tips-and-tricks
1 Answer
You can use HAProxy for load balancing, there are articles about it here:
https://digitalocean.com/community/articles/an-introduction-to-haproxy-and-load-balancing-concepts
here:
https://digitalocean.com/community/articles/how-to-use-haproxy-to-set-up-mysql-load-balancing--3
and here:
https://digitalocean.com/community/articles/how-to-use-haproxy-as-a-layer-4-load-balancer-for-wordpress-application-servers-on-ubuntu-14-04

With a single HAProxy node, this woulds still leave a single point of failure. Since DO doesn't support floating IPs (yet) you can't scale this up to having 2 geodiverse HAProxy nodes. That said, it's still an improvement over round robin since an app node is far more likely to go down than a slim, hardened HAProxy node.

You can also use nginx for load balancing (this is quite popular these days):
https://digitalocean.com/community/articles/how-to-set-up-nginx-load-balancing

nginx will have the same issue that HAProxy does, in that you still have a single point of failure.

Since DO doesn't support floating IPs (yet), I'll mention Amazon's Route 53 which is capable of intelligent round robin, health checking destination nodes, and geo-diverse hosted DNS, it's also relatively cheap:
http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/Tutorials.html

You can use Route 53 in conjunction with DO droplets. I believe DO is working on their own implementation of floating IPs to solve the super high availability problem.
by Etel Sverdlov
This article covers how to set up a simple load balancer on a DigitalOcean droplet with nginx. The tutorial covers setting up a round robin loadbalancer that can then direct site visitors to one of a set of IPs
Have another answer? Share your knowledge.