We have setup two DNS A records, where each points to a load balancer.

nslookup ourdomain.com


Non-authoritative answer:
Name:   ourdomain.com
Name:   ourdomain.com

Upon benchmarking this setup, using Apache Bench ab -n 5000 -c 5 http://ourdomain.com/, I noticed that requests are not evenly distributed to both load balancers at all. Literally, most every request is sent to a single load balancer.

enter image description here

I was under the impression that round-robin DNS should distribute requests to both. Do I have something misconfigured?

  • 2
    Most people consider round-robin DNS a poor man's form of load balancing for a reason. Because of caching (by ISP's, resolvers and end-users) but also requests from networks behind proxy servers there is no guarantee that the actual load will distributed in any even fashion. – HBruijn Jul 22 '15 at 19:58
  • HBruijn is correct, but in addition you did not confirm whether or not you performed your test after the TTL of the A record you had changed expired. I would under no circumstances expect the traffic to be even (first record will probably win by a noticeable margin), but this is the type of split I would expect if the remote clients had the old version of that record in cache or if the second IP was nonroutable by some of the clients. Also ensure that the device you're running the load test on does not have a host file entry. – Andrew B Jul 23 '15 at 6:55
  • It's also entirely possible that the tool you're using does the DNS lookup once and then uses that IP address for the tests. – wurtel Jul 23 '15 at 9:59

Your Answer

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

Browse other questions tagged or ask your own question.