I wish to understand the idea of anycast /dns based load balancing.

Let us assume situation is as follows Website is www.aaa.example There are 3 datacenters in Europe/Asia/america that I wish to loadbalance with haproxy loadbalancer on each datacenter and also httpd servers behind them hosting www.aaa.example (also route users to appropriate DC)

1.DNS based load balancer will have 3 entries in A record and round Robin algorithm. (How will europe users get to Europe DC)?

Anycast will be based on number of hops.

2.Those 3 loadbalancers will have diffrent public IP what will happen to user in europe when DC in Europe is down in DNS /anycast method?

3.Will user in any of those methods will see some error when accessing the site?

4.Finally is keepalived possibile on haproxy on public ips between diffrent DCS? (Is this even have a sense outside of local network)?


Popular tools for global load balancing are the distributed Internet systems, DNS and (anycast) routing.

DNS resolves a name to regional IP addresses on the appropriate continent. Name resolution can be smart and aware of location, service availability and other metrics, or not-smart and just static or round robin. You don't control where users go with a round robin.

Anycast advertises the same IP multiple places and uses routing to reach one. It is good at one-time conversations like DNS or getting a static resource in a content delivery network, but will not go to the same place reliably.

Clusters like keepalived are optimized for local hosts. The protocols they use like VRRP cannot span subnets.

Load balancers like haproxy do not really help because they do not steer the conversation from the start. It would be very slow for the Europe haproxy to send a request to a backend in America. GSLB products that do this are often an implementation of smart DNS.

Users will see errors upon failure until you direct them somewhere else. How quickly failures can be detected and routed around depends on your design.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.