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

From: FinalBSD <finalbsd#gmail.com>
Date: Thu, 19 Feb 2009 14:51:03 +0800


Hi Willy and Malcolm,

    Thanks for the reply, and the comments are perfectly, expect we can see the new features in the next release:)

thanks again.

2009/2/19 Willy Tarreau <w#1wt.eu>

> 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 :
>
> - I'm interested in the feature by itself
>
> - I'm opposed to complexify the "option httpchk" syntax even more, and
> I'd prefer that we extend the "http-check" keyword which was designed
> for that purpose. Let's use "http-check expect string XXX" and
> "http-check expect ! string XXX". That way we can later extend to
> support regex, length and md5sums (which some people have been asking
> for too).
>
> - while I understand the problem with apache returning a 302 on a 404,
> I'm strongly opposed to change the default behaviour which will break
> a lot of setups. 2xx and 3xx *are* valid return codes. What can be
> done however, is to extend the syntax proposed above :
>
> 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:51

This archive was generated by hypermail 2.2.0 : 2009/02/19 09:00 CET