Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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!

share|improve this answer
    
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 –  Glenn Slaven Mar 11 '13 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. –  JakeGould Mar 11 '13 at 15:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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