Re: A patch for haproxy 1.3.15.7 (HTTP-ECV)

From: Willy Tarreau <w#1wt.eu>
Date: Thu, 19 Feb 2009 07:42:41 +0100


Hi Malcolm,

On Wed, Feb 18, 2009 at 12:39:08PM +0000, Malcolm Turnbull wrote:
> FinalBSD,
>
> Ace, I was hoping someone would add that feature.
> Just tested it and it works perfectly.
>
> My tests were:
> 1) check index.html for value "mytesttext" - result - OK site up -
> CORRECT (text is present on my page)
> 2) check index.html for value "not found" - result - site down -
> CORRECT (text not present on my page)
> 3) check doesntexist.html for value "not found" - result - site down
> - CORRECT (even though text is present on apache error page)
>
> Ldirectord / LVS also has a seperate interval time for http health
> checks (so you can make it longer),
> and also the option to do x TCP checks followed by 1 HTTP/grep check
> (to lower the impact of health checks on the cluster)
> These are just ideas for improvements but core feature is very useful,
> thanks again.

These can be good ideas indeed, for instance when the HTTP check is sent to an expensive servlet which checks the whole process' health. Using this, we could check the port more often (say every 100ms) and do a full check less often (eg: every 2-5s) without fearing check timeouts either.

BTW, have you tried to use the fastinter keyword ? It allows you to perform fast checks once one check has failed. It significantly shortens the detection time.

Concerning the patch below, I have several comments :

       http-check expect status 200
       http-check expect ! status 302
       etc ...

Regards,
Willy

> 2009/2/18 ?$B6)hDI7 <finalbsd#gmail.com>
> >
> > Hi folks,
> > I wrote a patch and add two new features for haproxy(1.3.15.7) yesterday .
> >
> > 1. HTTP-ECV(Extended Content Verification) monitor
> >
> > add "receive" keyword for HTTP-ECV monitor.
> > ECV monitors use specified request uri and receive String settings in an attempt to
> > retrieve explicit content from backend nodes. The check is successful when
> > the content matches the Receive String value.
> > Syntax: option httpchk GET /uri [receive <receive string>] [HTTP/1.0]
> > -------------------------------------------------------------------------------------
> > backend www
> > balance source
> > cookie SERVERID insert indirect
> > option httpchk GET /http-ecv.php receive "Hello World!" HTTP/1.0
> > server www1 192.168.1.2:80 cookie A check port 80 inter 2000 rise 2 fall 2
> > -------------------------------------------------------------------------------------
> >
> > 2. When check the reply of services, only 2xx is OK .
> >
> > If 2xx and 3xx are OK, assuming the following :
> >
> > Apache configuration:
> > -------------------------------------------------------------------------------------
> > ErrorDocument 404 http://www.example.com/404.html
> > -------------------------------------------------------------------------------------
> > Haproxy Config:
> > -------------------------------------------------------------------------------------
> > option httpchk GET /check.php HTTP/1.0
> > -------------------------------------------------------------------------------------
> > So, if the file(check.php,) does not exists on the server(s), the check will be redircted to
> > http://www.example.com/404.html and get response code 302, it's still will be OK, but actually it's not.
> >
> > Pls forgive my poor english and non-skilled C programming ability.
> >
> > Regards!
> > FinalBSD
> >
> >
> >
>
>
> --
> Regards,
>
> Malcolm Turnbull.
>
> Loadbalancer.org Ltd.
> Phone: +44 (0)870 443 8779
> http://www.loadbalancer.org/
Received on 2009/02/19 07:42

This archive was generated by hypermail 2.2.0 : 2009/02/19 08:45 CET