1

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.

4
0

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.

15
  • Thanks for the reply. Apache is not restarting after using that attribute. Is that available in Apache 2.2.4? If it is, I tried using the following forms: ProxyTimeout 3 and ProxyTimeout=3 – JavaScript_Guru Nov 24 '14 at 19:34
  • @JavaScript_Guru Yup: httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxytimeout Where did you put the directive? – Shane Madden Nov 24 '14 at 19:35
  • Here: BalancerMember '10.10.10.10:80/outside loadfactor=1 retry=60 ProxyTimeout=3' – JavaScript_Guru Nov 24 '14 at 19:37
  • @JavaScript_Guru Ahh, ok: It either needs to be on its own line after </Proxy>, and note that the syntax is ProxyTimeout 3 and not ProxyTimeout=3 - or, alternatively, you can have it on your BalancerMember lines by setting timeout=3. – Shane Madden Nov 24 '14 at 19:39
  • Ok. I added it underneath like you said. However, it doesn't seem to make a difference in timing. To give some more info: When my webpage loads, it calls on the services behind the proxy server several times. Could that be contributing to the problem? – JavaScript_Guru Nov 24 '14 at 19:42

Your Answer

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

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