Re: haproxy and compression... Anybody?

From: Unai Rodriguez <me#u-journal.org>
Date: Tue, 08 Jul 2008 20:46:40 -0600


> no kidding? could you perhaps anonymize the example config? will that do?
> change the hostnames, change the ip addresses if necessary...

OK, here is the example. My setup is:

http://technet.microsoft.com/en-us/library/bb742379.aspx

Now, I two scenarios: first connecting direct to the web server and second connecting through HAProxy. I have captured the headers that correspond to one of the requests, using the following Mozilla Firefox extension (well, basically a packet sniffer):

http://livehttpheaders.mozdev.org/



SCENARIO #1 - Direct Request to the Web Server (you my find this info at: http://pastebin.ca/1066173)

GET /test/history.htm HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
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: 300
Connection: keep-alive
Referer: http://example.com/test/default.aspx Cookie: ASP.NET_SessionId=4ouzje55uc0g0q34mvrb24a3; casauth=5FFA4F0806B5633CF548D04A95AA681DE8362FC05FACE3E83CB708F5A627747ECD479398FA74F0FDF02CE40668BB0F0984CE5ABC945A6765C36F67B4DBD32F29AD32C890D2E3EBE6ED6B824D04A36510

HTTP/1.x 200 OK
Server: Microsoft-IIS/5.0
X-Powered-By: ASP.NET
Content-Encoding: gzip
Date: Wed, 09 Jul 2008 02:18:22 GMT
Content-Type: text/html
Accept-Ranges: bytes
Last-Modified: Thu, 17 Apr 2008 06:46:50 GMT Etag: "06928d056a0c81:1681"
Content-Length: 574
Expires: Wed, 01 Jan 1997 12:00:00 GMT
Cache-Control: max-age=86400
Vary: Accept-Encoding


+++



SCENARIO #2 - Request to the Web Server passign through HAPRoxy (you my find this info at: http://pastebin.ca/1066174)

http://example.com/test/history.htm

GET /test/history.htm HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
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: 300
Connection: keep-alive
Referer: http://example.com/test/default.aspx Cookie: DPSOP-UAT=s1; ASP.NET_SessionId=ur1s44mdyywamh45kuh2t245; casauth=7A3E96223D5578FBFD56404CFC6DEB2C27250FDA63D2B4BD4E28B5868625BD796FBD52C00B430D0A6C2760CCC2EED9117DB9469ED299197E89DDEAE4A466B3B547888A10BAE0C4F2CDE2980D72F1EBE0DD79714C723690607A83E48BC8955E18

HTTP/1.x 200 OK
Server: Microsoft-IIS/5.0
X-Powered-By: ASP.NET
Content-Encoding: gzip
Date: Wed, 09 Jul 2008 02:28:54 GMT
Content-Type: text/html
Accept-Ranges: bytes
Last-Modified: Thu, 17 Apr 2008 06:34:26 GMT Etag: "05b31455a0c81:1693"
Content-Length: 574
Expires: Wed, 01 Jan 1997 12:00:00 GMT
Cache-Control: max-age=86400
Vary: Accept-Encoding
Connection: close


Notes.-

  1. You can see how the second scenario (the one that goes through HAProxy) includes an extra cookie which has been provided by HAProxy: "DPSOP-UAT=s1"
  2. Both requests have the header "Content-Encoding: gzip" which indicates compressed http traffic
  3. The Content-Length is the same on both: 574

Let me know if you want more details. I will provide, it is not a privacy issue or anything, I am more than happy to discover new things out. When I said "I cannot provide right now" is because I was busy... but my brain couldn't stop thinking about this...

unai Received on 2008/07/09 04:46

This archive was generated by hypermail 2.2.0 : 2008/07/09 05:00 CEST