HTTP load balancing.

Hi,

We have 2 pools of servers. Lets call them A and B and they would contain 2 servers each. Pool A will be hosting www.example.com/app/v1 and pool B will be hosting www.example.com/app/v2. Clients will be requesting right url (/v1 or /v2) but will be hitting just one IP.

I'd like to:
1) send traffic to the right pool.
2) load balance it across servers in that pool

So what are my options? Any examples please? Is it possible to do that with just one box acting as a proxy/load balancer?

Many thanks
Chris

If you are just serving out different applications or static data, then you don't really need 2 pools of servers, just a load balancer. You can then set them up as virtual servers.

The load balancer IP is the only one you would expose and it would tag a session to whichever server it decides to go on based on whatever load balancing algorithm it uses.

take a look at this:

Hi Mark54g,

Thank you for your time. I've managed to do what I wanted yesterday but didn't have time to post back. Unfortunately I needed 2 pools - some servers are migrated to VM, some need to stay physical for time being. 2 different apps as well (luckily stateless so no need for stickiness). End of the day, very easy config.

For future reference, simplified config from apache:

<Proxy *>
    Order deny,allow
    Deny from all
    Allow from 10.100.0.0
</Proxy>


<Proxy balancer://app1>
BalancerMember http://10.10.10.1:80 ping=1
BalancerMember http://10.10.10.2:80 ping=1
</Proxy>

<Proxy balancer://app2>
BalancerMember http://10.10.10.3:80 ping=1
BalancerMember http://10.10.10.4:80 ping=1
</Proxy>


ProxyPass /v1 balancer://app1
ProxyPass /v2 balancer://app2

Hope that helps!
Chris

You still really don't need 2 pools, but if it works, sure, use it.

Don't forget proxypassreverse

http://knowledge.oscc.org.my/solution-areas/infrastructure/web-server/apache-proxypass-and-proxypassreverse-directives