Hi Sébastien and Baptiste,

Le 26/01/2015 23:12, Baptiste a écrit :

Le 26 janv. 2015 13:43, "Sébastien ROHAUT"
<[email protected] <mailto:[email protected]>>
a écrit :
 >  (...)
 > For the http-check, we want to test the value of  "healthStatus",
which can be "Healthy", "Unhealthy", "DegradedMode". Our server must be
put out of the backend only if value is ""Unhealthy". So, we tried this :
 >
 > http-check expect ! string "healthStatus":"Unhealthy"
 >
 > But it doesn't work as expected.
 > (...)

What does your option httpchk look like?

I was just making some tests.
I think this is happening because the buffer is not full and the server didn't close the connection, which happens when the server is using keep-alive. As checks don't handle the HTTP connection type, haproxy is waiting fore more data until a timeout occurs.

Sébastien, in order to prevent keep-alive, you should try with one of this solution in your httpchk line :
- use HTTP/1.0
- or append \r\nConnection:\ close

Maybe this is something we should consider to add in the documentation, or we can try to parse HTTP headers for a Content-Length header or for chunks (it might require a lot of work). Or maybe we can transparently add the "Connection: close" header to any http check sent from haproxy.

--
Cyril Bonté

Reply via email to