Load balancing between datacenters

Clint Byrum clint at ubuntu.com
Thu Sep 6 15:08:20 UTC 2012


Excerpts from Jesus arteche's message of 2012-09-06 06:03:11 -0700:
> Hey guys,
> 
> I am trying to create a ha infrastructure. I would like to have my
> infrastructure in a cloud/vps provider in europe and a replica in USA. I
> will create load balancers in a HA mode. My problem comes up when I think
> how to share the floating ip. I mean in a datacenter with the same range of
> IP is not a problem...but when the datacenters are in different ranges of
> ip's ...it shouldn't work...
> 
> Any ideas about how to do it?

There are a few approaches to this. They all boil down to some abuse
of DNS.

DNS based load balancing works by using low TTL's and an actively
maintained list of the known working IP's. So basically each DC gets
one floating IP and is monitored for availability. DNS clients are fed
only those IPs that are available. Some nice commercial load balancers
will also look at server load on all DC's and shift traffic to other
DCs when one is overloaded by leaving the overloaded DC out of some DNS
responses. Also there are some of these that will use GeoIP or AnyCast
to send users to a closer DC.

This has a HUGE latency drawback because of the low TTLs. If the TTLs
are raised, then the system becomes much less responsive to a down DC.

The *simplest* thing to do is to feed back all of those DC IPs and
hope that clients are smart enough to fail-over quickly, which most web
browsers are. Of course, this will not give you good balancing between
the DCs because of caching and clients just doing the wrong thing.




More information about the ubuntu-server mailing list