Hi Sébastien,

Le 27/01/2015 10:43, Sébastien ROHAUT a écrit :
To complete my answer, All of theses are working :
- Adding Connection: close header
- Moving to HTTP/1.0
- set the keepalive timeout to 0 in webserver configuration

HTTP/1.0 is not the best solution, because some webservers (jetty...)
return a Connection: keep-alive, as it's supported by the protocol.

But, the best thing to do should be to modify the way haproxy get the
content (for the health check) : check for the Content-Length, which is
the best solution.

OK thanks for your feedback.
Please keep the mailing list in CC when you reply ;-)



2015-01-27 7:22 GMT+01:00 Sébastien ROHAUT
<[email protected] <mailto:[email protected]>>:

    Cyril, we found the answer at the same time ! This is the keepalive.
    And yes I think the doc should be updated.
    It works if in my nginx configuration I disable keepalive for this
    url or if I use http 1.0.

    thank you

    Sebastien

    Le 26 janv. 2015 23:25, "Cyril Bonté" <[email protected]
    <mailto:[email protected]>> a écrit :

        Hi Sébastien and Baptiste,

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


            Le 26 janv. 2015 13:43, "Sébastien ROHAUT"
            <sebastien.rohaut.pro@gmail.__com
            <mailto:[email protected]>
            <mailto:sebastien.rohaut.pro@__gmail.com
            <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é




--
Cyril Bonté

Reply via email to