0

So I have mod_proxy setup pointing at

ProxyPass / http://www.mydomain.com/
ProxyPassReverse / http://www.mydomain.com/

and www.mydomain.com has 4 A records (ie DNS load balancing) will mod_proxy pick 1 ip from that list for all it's worker processes and expire on the ttl of the DNS record, or will each worker process pick its own IP from that list?

I'm setting up a proxy sitting in front of a web server that is using this DNS load balancing, and I don't want to have to hard-code their IP addresses into BalancerMember directives as then they can't add & remove IP addresses without changing the proxy too.

1 Answer 1

0

I don’t think mixing DNS load balancing & mod_proxy load balancing will help anything. The IP choice in DNS load balancing is independent of any Apache settings you have so your load balancer will be at the mercy of whatever DNS IP address comes up when it rolls the dice.

I would suggest that you really rethink this & instead do the following:

  1. For the servers you already have set as A records, change them all to also respond to differently named DNS entries such as www0.mydomain.com & www1.mydomain.com and such.
  2. Set up the Apache configs for www0.mydomain.com & www1.mydomain.com to only deliver content to the IP of your load balancer.
  3. Configure your load balancer to respond to www.mydomain.com and set the mod_proxy setup to utilize www0.mydomain.com & www1.mydomain.com

This is really the only way to truly use a real load balancing solution. Because honestly DNS load balancing is a sloppy mess that I have never seen work well in practice in my 20+ years of doing web & Unix work. Apache mod_proxy is a bit tricky to setup, but the setup works very well & gives you more future options than you might even use; very future proof & scalable.

Good luck!

2
  • I don't have access to the origin servers, they're not mine so changing them is not an option. In addition, do a host www.google.com and you'll see that they're using DNS load balancing Mar 11, 2013 at 12:32
  • When you have a huge amount of servers like Google does, you can do something like DNS load balancing. Also, when you do DNS load balancing you are reverse proxying from a main authority server. If you truly have a small cluster of servers, DNS load balancing is not that useful & mod_proxy load balancing is the better choice. So the best choice is IP address. Past that, not much you can do. Mar 11, 2013 at 15:16

You must log in to answer this question.

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