2

Looking for a cheaper solution than amazon CloudFront, I placed two "A" records with different IPs to different servers on the same subdomain in a NameSever managed by GoDaddy in order to achieve some kind of load balancing and fail over mechanism for static files in my website.

Check it out: nslookup static.hsbnoticias.com

SOME OBSERVATIONS

  • I have seen some articles about DNS round-robin load balancing but I have been unable to understand if this can be done with any DNS service or if it requires some special software or service.
  • I have not found any service providers for such a service
  • Testing nslookup on the facebook CDN returns multiple IPs in different order every time which I guess is the proper way to do DNS load balancing
  • My NameServer returns the IPs in the same order every time

QUESTIONS

  1. Is the load going to be distributed between the two servers?
  2. Is there a standard behavior that browsers tend to follow while resolving domains with multiple IPs on page resources? (Timeout, fallback, etc...)
  3. How does the randomized (or fixed) order of the records returned by the name server affect load balancing?
  4. Will browser try different IPs when the one they're using becomes slow, or only when it triggers a timeout?
  5. Will IP Fail Over be transparent to the user, or is the user going to need to reload the page?

1 Answer 1

3
  1. Mostly, yes. This poor-man way of doing it leaves the returned order of the A records to the discretion of the DNS server a client is using, so if round-robin is turned off or not supported (as with your local nameserver), clients using it will get a fixed ordering returned for as long as it's cached. But it at least does provide redundancy (if one IP is down but tried first, browsers generally will use the other one after a connect timeout).

  2. Not consistently, no. They will all fallback to a second (or more) IP address, but it depends on browser "vendor" and version and whether or not any ICMP unreachable messages are returned, to determine how long that fallback takes. TCP timeouts -- without receiving any ICMP unreachable messages -- are usually measured in minutes when a server is not responding. E.g., Chrome has a long connect timeout, often more than 3 minutes before failing over. IE is faster. But it will just appear to the user to be down or really slow. Caveat emptor... there's a lot of moving parts along DNS resolution paths and you have little control over the order that multiple returned IP addresses are finally used in a given browser. This is why there is a whole industry of products that support fast-failover load-balancing, but they generally use DNS in a minimal fashion to accomplish it (e.g., lookup www.google.com in DNS... you'll find you only get back ONE IP address.)

  3. The load "balancing" across your severs can vary significantly between any two time periods.

  4. Only on connect timeout or explicitly unreachable.

  5. It will be transparent, but the site can appear really slow if the instance IP they are connecting to is hung. If you intentionally take it down (e.g., for maintenance), the fallback will be faster if it's off the network and ARP requests are not answered (router will report back with ICMP host unreachable).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .