Re: #578: getting real-ish numbers for option 3

On Fri, Oct 24, 2014 at 08:56:08PM +0200, Willy Tarreau wrote:
> I have not yet tried to modify your program to vary the output between a
> browser (less custom) or a partner site (more custom). But I wanted to share
> these results already as I think they can be helpful.

OK so I did experiment a bit with it, by changing numCustom, randPortion,
and the header length in xrange() (which I couldn't manage to make random,
I don't know python unfortunately so I stopped after a few failed attempts).
BTW, your program is east to tweak, I like the ability to play with the
random ratio :-)

With 0 custom header, both option3 and its revision show exactly
identical encoding size as draft-09. Things start to diverge as we
add some custom headers, make them random, and/or shrink them.
Here are a few measures :

1 custom, 0 random
==================

              Draft09       Option3   Option3-rev
Out Bytes       290515       290516      290515
Comp ratio    0.127440     0.127441    0.127440
Avg int len   1.000000     1.000014    1.000000

10 custom, 0 random
==================
              Draft09       Option3   Option3-rev
Out Bytes       380494       380495      380494
Comp ratio    0.051046     0.051046    0.051046
Avg int len   1.000000     1.000006    1.000000

10 custom, 1 random (40 chars)
==============================
              Draft09       Option3   Option3-rev
Out Bytes       807817       800899      800154
Comp ratio    0.108350     0.107422    0.107322
Avg int len   1.268482     1.228282    1.223953

10 custom, 5 random (40 chars)
==============================
              Draft09       Option3   Option3-rev
Out Bytes      2317974      2267884     2264295
Comp ratio    0.310991     0.304270    0.303789
Avg int len   1.347906     1.119018    1.102618

10 custom, 9 random (40 chars)
==============================
              Draft09       Option3   Option3-rev
Out Bytes      3642593      3554173     3548090
Comp ratio    0.488855     0.476989    0.476172
Avg int len   1.391184     1.051465    1.028093

10 custom, 10 random (40 chars)
==============================
              Draft09       Option3   Option3-rev
Out Bytes      3775212      3683286     3676886
Comp ratio    0.506571     0.494236    0.493378
Avg int len   1.395324     1.048590    1.024449

10 custom, 1 random (15 chars, like an IP address)
==================================================
              Draft09       Option3   Option3-rev
Out Bytes       619601       612145      611510
Comp ratio    0.086027     0.084992    0.084904
Avg int len   1.380320     1.336844    1.333141

10 custom, 5 random (15 chars, like an IP address)
==================================================
              Draft09       Option3   Option3-rev
Out Bytes      1315119      1266085     1262805
Comp ratio    0.211944     0.204041    0.203513
Avg int len   1.396611     1.170302    1.155164

10 custom, 9 random (15 chars, like an IP address)
==================================================
              Draft09       Option3   Option3-rev
Out Bytes      1890435      1802153     1796431
Comp ratio    0.363410     0.346439    0.345339
Avg int len   1.409927     1.068155    1.046003

10 custom, 1 random (4 chars like for "True", "On", "off", "none", ...)
=======================================================================
              Draft09       Option3   Option3-rev
Out Bytes       537138       529401      528759
Comp ratio    0.075722     0.074632    0.074541
Avg int len   1.434113     1.388931    1.385182

10 custom, 5 random (4 chars like for "True", "On", "off", "none", ...)
=======================================================================
              Draft09       Option3   Option3-rev
Out Bytes       867352       818404      815336
Comp ratio    0.153420     0.144762    0.144219
Avg int len   1.422646     1.195593    1.181362

10 custom, 9 random (4 chars like for "True", "On", "off", "none", ...)
=======================================================================
              Draft09       Option3   Option3-rev
Out Bytes      1111734      1023424     1018046
Comp ratio    0.263832     0.242875    0.241598
Avg int len   1.418619     1.075517    1.054622

10 custom, 10 random (4 chars like for "True", "On", "off", "none", ...)
=======================================================================
              Draft09       Option3   Option3-rev
Out Bytes      1017368       924432      918561
Comp ratio    0.263935     0.239825    0.238302
Avg int len   1.417041     1.064313    1.042030


Note that at this point, we've reached 10% savings on the wire!

So I guess that if Jeff is using a lot of custom headers as he says,
he might very well have observed a significant degradation. It's worth
noting that the encoded integer length quickly reaches high levels as
soon as there are a few random custom headers in draft-09. The shorter
these custom headers, the higher the impact of the integer encoding.
In the last example above, an average request was 102 bytes with
draft-09 and only 92 with the proposals. That's 10 bytes saved per
request for only 10 short custom headers. I think it's worth studying
that option.

Best regards,
Willy

Received on Friday, 24 October 2014 19:40:10 UTC