On Thu, Jan 31, 2013 at 08:39:43AM -0500, Chris Burroughs wrote:
> I'm using haproxy 1.4.17 if that's relevant.  I tried replacing
> http-server-close with http-pretend-keepalive, which as far as I can
> tell had no effect to client side keepalive behaviour.

it's not a replacement but a complement, you need to have both, because :
  1) you want to close server connections
  2) you want to pretend that you'll keep them alive

>  Responses still
> looked something like this:
> 
> < HTTP/1.1 200 OK
> < Server: Apache-Coyote/1.1
> < Cache-Control: max-age=125
> < Content-Type: application/json;charset=UTF-8
> < Date: Thu, 31 Jan 2013 13:25:54 GMT
> < Connection: close
> <
> * Closing connection #0

Indeed, and as you can see, there is nothing here which allows to
maintain the connection open (length is not specified).

> I then tried enabling keepalive on the backend (tomcat), after which
> curls directly too the backend looked like:
> 
> < HTTP/1.1 200 OK
> < Server: Apache-Coyote/1.1
> < Cache-Control: max-age=63
> < Content-Type: application/json;charset=UTF-8
> < Transfer-Encoding: chunked
> < Date: Thu, 31 Jan 2013 13:24:13 GMT
> <
> * Connection #0 to host HOST left intact

This one has everything needed, transfer-encoding: chunked specifies the
size so the connection can stay alive.

> But responses from haproxy still closed with either http-server-close or
> http-pretend-keepalive set still close the connection.  I admit these
> results are confusing and I feel like I'm missing something.

You definitely need to have both options set, and no "httpclose" at all.

Note that 26 bugs were fixed in 1.4 since your version, and you should
plan an upgrade. I'm seeing nothing related to your issue so I think
it's just a configuration issue.

Willy


Reply via email to