Problem getting http-server-close to work with Jetty backend

From: Patrik Nilsson <patrik#jalbum.net>
Date: Tue, 30 Mar 2010 11:51:50 +0200


Hi,

We have been trying to get the new keep-alive functionality, with the http-server-close option, to work with our Jetty back-end web servers. There seems to be something in the response from the Jetty servers that makes HaProxy always add a Connection: close header in the response to the client though.

Running the same HaProxy configuration with an Apache backend works fine.

I've included examples below showing the requests and responses when going directly to the backend server, bypassing haproxy, and then the same request going through haproxy, for the Apache and Jetty backends.

One obvious difference in the response from the Apache server is that it includes explicit keep-alive headers, but if I understand the matrix in the connection-header.txt (included in doc/internals) that shouldn't matter - as long as the Jetty server doesn't send a Connection: Close, includes a Content-Length header and both client and server use http/1.1 HaProxy should not add a Connection: Close header in the response to the client.

Any ideas what might be causing our problems?

Thank you,

Patrik



   JETTY backend.

Direct:


*Request*

GET /res/jalogo.png HTTP/1.1
Host: jetty.jalbum.test
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 GTB6 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

*Response*

HTTP/1.1 200 OK
Date: Mon, 29 Mar 2010 15:32:10 GMT
Expires: Tue, 30 Mar 2010 15:32:10 GMT
Content-Type: image/png

Cache-Control: max-age=86400
Last-Modified: Tue, 16 Mar 2010 10:55:16 GMT
Accept-Ranges: bytes

Content-Length: 7491
Server: Jetty(6.1.21)

Through HaProxy:


*Request*

GET /res/jalogo.png HTTP/1.1
Host: jalbum.test
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 GTB6 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

*Response*

HTTP/1.1 200 OK
Date: Mon, 29 Mar 2010 15:34:42 GMT
Expires: Tue, 30 Mar 2010 15:34:42 GMT
Cache-Control: max-age=86400
Content-Type: image/png
Last-Modified: Tue, 16 Mar 2010 10:55:16 GMT Accept-Ranges: bytes
Connection: close
Server: Jetty(6.1.21)



   APACHE backend.

Direct:


*Request*

GET /gifs/green.gif HTTP/1.1
Host: apache.jalbum.test
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 GTB6 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

*Response*

HTTP/1.1 200 OK
Date: Mon, 29 Mar 2010 15:37:15 GMT
Server: Apache/2.2.10 (Linux/SUSE)
Last-Modified: Wed, 27 May 2009 15:02:43 GMT Etag: "de39-76-46ae622a36ac0"
Accept-Ranges: bytes
Content-Length: 118
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: image/gif

Through HaProxy:


*Request*

GET /gifs/green.gif HTTP/1.1
Host: jalbum.test
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 GTB6 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

*Response*

HTTP/1.1 200 OK
Date: Mon, 29 Mar 2010 15:26:17 GMT
Server: Apache/2.2.10 (Linux/SUSE)
Last-Modified: Wed, 27 May 2009 15:02:43 GMT Etag: "de39-76-46ae622a36ac0"
Accept-Ranges: bytes
Content-Length: 118
Content-Type: image/gif Received on 2010/03/30 11:51

This archive was generated by hypermail 2.2.0 : 2010/03/30 12:00 CEST