Hi Tim,
On Mon, Jul 04, 2016 at 08:35:54AM +0000, Richert, Tim wrote:
> Ohh... just figured that compression works if "option http-server-close" is
> NOT set!
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> curl -o/dev/null -D - -w "Transferred: %{size_download}\n" -\#
> "http://application-via-proxy:8080/restxq/mappings" -H "Accept-Encoding: gzip"
> HTTP/1.1 200 OK
> Set-Cookie: JSESSIONID=1blw9hvxg471ibwtdusi40w6h;Path=/
> Expires: Thu, 01 Jan 1970 00:00:00 GMT
> Cache-Control: max-age=3600,public
> Content-Type: application/json; charset=UTF-8
> Transfer-Encoding: chunked
> Server: Jetty(9.3.9.v20160517)
> Content-Encoding: gzip
>
> ########################################################################
> 100,0%
> Transferred: 7109
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> haproxy:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 00000008:frontend.accept(0006)=0009 from [127.0.0.1:51458]
> 00000008:frontend.clireq[0009:ffffffff]: GET /restxq/mappings HTTP/1.1
> 00000008:frontend.clihdr[0009:ffffffff]: User-Agent: curl/7.29.0
> 00000008:frontend.clihdr[0009:ffffffff]: Host: application-via-proxy:8080
> 00000008:frontend.clihdr[0009:ffffffff]: Accept: */*
> 00000008:frontend.clihdr[0009:ffffffff]: Accept-Encoding: gzip
> 00000008:backend.srvrep[0009:000a]: HTTP/1.1 200 OK
> 00000008:backend.srvhdr[0009:000a]: Set-Cookie:
> JSESSIONID=1blw9hvxg471ibwtdusi40w6h;Path=/
> 00000008:backend.srvhdr[0009:000a]: Expires: Thu, 01 Jan 1970 00:00:00 GMT
> 00000008:backend.srvhdr[0009:000a]: Cache-Control: max-age=3600,public
> 00000008:backend.srvhdr[0009:000a]: Content-Type: application/json;
> charset=UTF-8
> 00000008:backend.srvhdr[0009:000a]: Transfer-Encoding: chunked
> 00000008:backend.srvhdr[0009:000a]: Server: Jetty(9.3.9.v20160517)
> 00000009:frontend.clicls[0009:000a]
> 00000009:frontend.closed[0009:000a]
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Is this the correct behavior? With fixed Content-Lengths it seems to be
> working either way...
I still cannot reproduce this here, I'm sorry. Both with http-server-close
and with keep-alive I'm seeing the chunked transfers being correctly
compressed :
(without option http-server-close) :
willy@wtap:lab$ curl -o/dev/null -D - -w "Transferred: %{size_download}\n" -\#
"http://127.0.0.1:8001/?s=10000&k=1" -H "Accept-Encoding: gzip"
HTTP/1.1 200
Transfer-Encoding: chunked
X-req: size=113, time=0 ms
X-rsp: id=dummy, code=200, cache=1, chunked, size=60003, time=0 ms (0 real)
Content-Encoding: gzip
######################################################################## 100.0%
Transferred: 122
haproxy says :
00000000:p.accept(0005)=0006 from [127.0.0.1:38000]
00000000:p.clireq[0006:ffffffff]: GET /?s=10000&k=1 HTTP/1.1
00000000:p.clihdr[0006:ffffffff]: User-Agent: curl/7.36.0
00000000:p.clihdr[0006:ffffffff]: Host: 127.0.0.1:8001
00000000:p.clihdr[0006:ffffffff]: Accept: */*
00000000:p.clihdr[0006:ffffffff]: Accept-Encoding: gzip
00000000:p.srvrep[0006:0007]: HTTP/1.1 200
00000000:p.srvhdr[0006:0007]: Transfer-Encoding: chunked
00000000:p.srvhdr[0006:0007]: X-req: size=113, time=0 ms
00000000:p.srvhdr[0006:0007]: X-rsp: id=dummy, code=200, cache=1, chunked,
size=60003, time=0 ms (0 real)
With the option on :
willy@wtap:lab$ curl -o/dev/null -D - -w "Transferred: %{size_download}\n" -\#
"http://127.0.0.1:8001/?s=10000&k=1" -H "Accept-Encoding: gzip"
HTTP/1.1 200
Transfer-Encoding: chunked
X-req: size=132, time=0 ms
X-rsp: id=dummy, code=200, cache=1, chunked, size=60003, time=0 ms (0 real)
Content-Encoding: gzip
######################################################################## 100.0%
Transferred: 122
00000000:p.accept(0005)=0006 from [127.0.0.1:38004]
00000000:p.clireq[0006:ffffffff]: GET /?s=10000&k=1 HTTP/1.1
00000000:p.clihdr[0006:ffffffff]: User-Agent: curl/7.36.0
00000000:p.clihdr[0006:ffffffff]: Host: 127.0.0.1:8001
00000000:p.clihdr[0006:ffffffff]: Accept: */*
00000000:p.clihdr[0006:ffffffff]: Accept-Encoding: gzip
00000000:p.srvrep[0006:0007]: HTTP/1.1 200
00000000:p.srvhdr[0006:0007]: Transfer-Encoding: chunked
00000000:p.srvhdr[0006:0007]: X-req: size=132, time=0 ms
00000000:p.srvhdr[0006:0007]: X-rsp: id=dummy, code=200, cache=1, chunked,
size=60003, time=0 ms (0 real)
00000001:p.clicls[0006:ffffffff]
00000001:p.closed[0006:ffffffff]
I tried as well when having the server advertise the close, but it didn't
change anything. I think I'll need a network capture of what goes into and
out of haproxy to try to figure what's happening.
Thanks,
Willy