[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haproxy
Subject:    Re: HAProxy health checks on servlets
From:       Willy Tarreau <w () 1wt ! eu>
Date:       2009-07-27 21:19:14
Message-ID: 20090727211914.GB25188 () 1wt ! eu
[Download RAW message or body]

On Mon, Jul 27, 2009 at 01:02:45PM -0400, Chuck Koscher wrote:
> I've got HAProxy performing health checks on Tomcat servers, but if an  
> individual servlet goes down on one Tomcat, HAProxy continues to  
> direct failed traffic towards it.
> 
> How can HAProxy be configured to recognize Tomcat's HTTP Status 503?

By default, everything not 2xx nor 3xx is a failure. Most likely
your checks don't reach tomcat but stop at the web server itself
which still responds 200. Using "option httpchk GET /url/../..."
you can indicate what request to send for the checks. It is highly
recommended that the response is provided by a servlet relying on
the same components as your applications. Some people like to perform
complex internal health checks once in a while using such servlets
(eg: check database connectivity, ensure that logs are still growing,
etc...). That said, a basic "hello world" is already very efficient
at detecting faulty servers.

Regards,
Willy


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic