Forum Moderators: phranque

Message Too Old, No Replies

Removing Tomcat node in Apache loadbalancing if it returns status 500

Removing node of LB if server is not healthy anymore

         

gmmatias

6:56 am on Jun 28, 2010 (gmt 0)

10+ Year Member



Hello,

We have two tomcat application that are load-balance by Apache via mod_proxy. Here is the configuration:

<Proxy balancer://tomcatcluster>
BalancerMember ajp://X.X.X.X:8009 route=tomcat-8000 ttl=10
BalancerMember ajp://X.X.X.X:9009 route=tomcat-9000 ttl=10
</Proxy>

ProxyPass / balancer://tomcatcluster/ stickysession=JSESSIONID nofailover=off


Sometimes it happens that one tomcat nodes becomes unhealthy due to OutOfMemoryErrors or other reasons. The two main symptoms would be non-responsiveness. Or returning HTTP status code 500 to requested pages.

At this point, the tomcat server is not healthy and Apache still does not disconnect it from the load-balanced nodes. This has an effect that some users get a:
status code 200 - if coming from the healthy tomcat node and
status code 500 - if coming from the unhealthy tomcat node

How can it be possible to tell Apache to remove a tomcat node if it returns status 500 many times?

Or are there other strategies in Apache to make this error handling better?

Thank you.