I need to know if apache can wisely and automatically detect if one of it's balanerMembers is down and consequently exempt it from serving the requests?
P.S. The back-end servers won't produce heartbeat.
Thanks
Comments:
I'm using mod_proxy in apache 2.4.7 My configuration for a sample site is like below, My problem is when one of the back-end servers goes unresponsive, My load balancer still sends requests to the dead back-end server and clients are complaining. What is wrong with the below config:
<Proxy balancer://X_Balancer>
BalancerMember http://firsthost.sth/ status=-SE
BalancerMember http://anotherhost.sth/ status=-SE
ProxySet lbmethod=bybusyness
</Proxy>
<VirtualHost IPofloadbalancer:80>
ServerName domainname
SSLProxyEngine On
Include /*/modsecurity.conf
<location />
ProxyPass balancer://X_Balancer/
ProxyPassReverse balancer://X_Balancer/
</location>
</VirtualHost>
Best Answer
If you use mod_proxy in Apache 2.2 you have limited configuration options, but Apache will detect unresponsive balancerMembers and distribute requests to any remaining balancerMembers.
Apache 2.4 has already some more options, but for more advanced options you're typically better off with more specialized load balancer software.
After your comments: It depends on how the balancerMember stops responding. If a connection can still be made, but no error code and no response is forthcoming you might benefit from setting the
timeout
andfailontimeout
options.timeout=5
Connection timeout in seconds. The number of seconds Apache httpd waits for data sent by / to the backend.failontimeout=on
If set, an IO read timeout after a request is sent to the backend will force the worker into error state. Worker recovery behaves the same as other worker errors.