Apache 2.2.4 Proxy Balancer Extremely Slow When a Balancemember is down

apache-2.2load balancingPROXYreverse-proxy

I am using apache 2.2.4 as a reverse proxy server in my DMZ. The Proxy Balancer appears to work great when the two BalancerMember servers are up. But if I shut one down, It takes roughly 30-45 seconds to get anything to load on my site every time I load a page. Here is my configuration:

ServerName mywebsite.com
ProxyRequests Off
<Proxy *>
Order deny, allow
Allow from all
</Proxy>

<Proxy balancer://mycluster>
BalancerMember http://10.10.10.10:80/outside loadfactor=1 retry=60
BalancerMember http://10.10.10.11:80/outside loadfactor=1 retry=60
</Proxy>

ProxyPass /outside balancer://mycluster/
ProxyPassReverse /outside balancer://mycluster/

ProxyPass /balancer-manager !

<Location /balancer-manager>
SetHandler balancer-manager
</Location>

The server acts as a reverse proxy for REST services that sit behind it. When I load the web application, it calls the
REST services multiple times, so I don't know if that could also be causing the slowness, as the Proxy is getting hit with many requests at once.

Best Answer

Set a ProxyTimeout to just a few seconds - what's happening is that it's sitting there trying connections to the down backend for a long while, not timing out.

Setting something like ProxyTimeout 3 will cause the connection to fail more quickly, then your retry=60 setting will cause the down server to not be used again for the next minute.