Re: Health checks: check for string in return data?

From: Willy Tarreau <w#1wt.eu>
Date: Mon, 30 Jun 2008 21:50:18 +0200


Hi Nate,

On Mon, Jun 30, 2008 at 02:17:29PM -0500, Nate Carlson wrote:
> Hey all,
>
> Curious if there's a way to tell HAProxy to check for a string when doing,
> for example, a HTTP health check. Some of our servers will return a 200 no
> matter what, but either say 'Server OK' or 'Server Down' in the reply..
> it'd be nice to be able to get HAProxy configured to read that instead of
> relying on a HTTP error being returned.

I've also received this request. This needs a more general rework of the health-checks, because right now, only the beginning of the response is read, but we cannot say that there is a proper "parsing". Some people want to be able to consider a check as failed if the find a regex in the response, or if they don't find a regex in the response. But since there is no unlimited buffer, the check may either scan a very small chunk reliably, or scan a larger one read at once in a shared buffer.

Do you know where in your response is the string you're looking for ? Is it close to the beginning or close to the end, and what is the size of the response ?

I'm asking, because maybe we could consider that for plain text, we may scan the whole response even in small chunks, if we always keep a buffer as large as the string we're looking for.

Regards,
Willy Received on 2008/06/30 21:50

This archive was generated by hypermail 2.2.0 : 2008/06/30 22:01 CEST