W3C home > Mailing lists > Public > ietf-http-wg@w3.org > April to June 2018

RE: QPACK and the Static Table

From: Mike Bishop <mbishop@evequefou.be>
Date: Thu, 24 May 2018 18:21:15 +0000
To: Roberto Peon <fenix@fb.com>, Willy Tarreau <w@1wt.eu>
CC: "quic@ietf.org" <quic@ietf.org>, HTTP Working Group <ietf-http-wg@w3.org>
Message-ID: <SN1PR08MB185459B20E930B87BAE380EFDA6A0@SN1PR08MB1854.namprd08.prod.outlook.com>
Yes, I think you need the lookup table for indices.  Alphabetical doesn't work as well, because there are two key barriers to deal with:

  *   Only the first sixteen entries can be name-referenced in a single byte.  We degraded performance in a previous draft of this table because :path wasn’t in the first sixteen entries, and the encoder that tried the updated table used two-byte name references for every request.
  *   Only the first sixty-four entries can be index-referenced in a single byte.



This implies that you want an ordering by likelihood of using the name at all, by likelihood of not indexing the value for repeat use, and by likelihood of using the name+value pair directly.



While an alphabetically-sorted list isn’t impossible within each tier, it seems easier to maintain a static map of the indices than to alphabetically index into each tier to see if the header you want is present.



I’d be open to additional sources of data to run the same query against.  Any browsers up to running an experiment and sharing the telemetry?



-----Original Message-----
From: Roberto Peon <fenix@fb.com>
Sent: Thursday, May 24, 2018 10:53 AM
To: Willy Tarreau <w@1wt.eu>; Mike Bishop <mbishop@evequefou.be>
Cc: quic@ietf.org; HTTP Working Group <ietf-http-wg@w3.org>
Subject: Re: QPACK and the Static Table



One could make the lookup (more) efficient by storing the index (a byte at most) with the key-value pair, where the key-value pair were sorted via whatever sorting you'd find most efficient.

If reordering allows for some increased efficiency without increasing bits-on-wire, I'd think it seems reasonable to change.



I would not trust the HTTP Archive to give a frequency analysis for real-world use. Remember that we gathered the freq data for HPACK from real-world use across a hopefully not-so-biased sample via browsers directly. If the world has changed since HPACK came out in terms of header freq (seems possible if not probable), then perhaps we should consider an update to HTTP2/HPACK as well?



I agree that perfection here isn't really needed, but I'm not sure adding items to the table arbitrarily makes sense either.



-=R



On 5/23/18, 9:42 PM, "QUIC on behalf of Willy Tarreau" <quic-bounces@ietf.org on behalf of w@1wt.eu<mailto:quic-bounces@ietf.org%20on%20behalf%20of%20w@1wt.eu>> wrote:



    Hi Mike,



    On Wed, May 23, 2018 at 11:16:18PM +0000, Mike Bishop wrote:

    > Rather than indexing the tables together and having the static table at 1-61,

    > QPACK uses a bit to indicate static vs. dynamic.  Since the field is seven

    > bits long, the performance is comparable for the dynamic table (you can

    > access 63 entries in one byte, 190 in two), but you can increase the size of

    > the static table without hurting the dynamic table.



    It will make the code look less "magic"!



    > As a result, we're

    > building a fresh static

    > table<https://github.com/quicwg/base-drafts/pull/1355> based on queries

    > against HTTPArchive data.

    >

    > The key question that has come up in a couple venues:  What real-world

    > headers do we want to artificially remove from what the data shows, and what

    > headers not seen by HTTP Archive do we want to force in anyway?



    I agree with Mark that request really is what matters the most.



    >   *   Reordered to put headers you're likely to name-reference at the front,

    >   especially if you're unlikely to add them to the dynamic table



    Well, some of us have been really bothered by the lack of ordering

    in the HPACK headers table, making it painful to perform efficient

    lookups. I'd suggest that they are sorted by (name,value) to make

    it possible to perform efficient dichotomic lookups.



    > The question is whether we should also backfill headers which HTTP Archive

    > wouldn't see, delete headers we wish people wouldn't use, and/or insert the

    > ones we hope they eventually will.  Some candidates:



    That's indeed a good point.



    >   *   Add Alt-Svc entry for HTTP/QUIC with QUIC v1

    >   *   Add X-Forwarded-For

    >   *   Don't add X-Forwarded-For, but do add Forwarded



    In practice, we can take both or none. After all, most QUIC requests going

    through proxies will be encrypted already thus the proxy will not be able

    to add these fields. For clear-text requests, the header field name is

    roughly as long as the value, so there's not *that* much to save by encoding

    them. And it will not change in most consecutive requests, so the dynamic

    compression will be more efficient than the static one. Thus I suggest that

    we only add them *if* we have enough unused slots at the end that we care

    to cover a very broad set.



    >   *   Remove Expires to incent the use of Cache-Control



    Expires is for responses only anyway, thus it matters much less. Cache-control

    can be used in both directions. I think that the technical focus on request

    may make Expires disappear from the table ;-)



    >   *   Collapse the "Content-Type: <thingey>" and "Content-Type: <thingey>; charset=utf-8" entries together

    >      *   ...but which one to keep?



    Probably just focus on the most reported ones and not try to collapse. I

    suspect that we see a lot of en-us alone, and utf-8 added to some other

    languages, but I could be wrong.



    >   *   Add Content-Encoding and/or Accept-Encoding entries for zstd



    Probably too early yet, and will not make a big difference overall (almost

    only response, 4 characters value).



    > There's an endless parade of bikesheds here.  As Martin has pointed out, this

    > will never be perfect, so the goal is "good enough and keep going."  Any

    > strong feelings about any of these before we merge it?



    No real strong feeling here except about the ability to perform fast lookups.



    > Also, there's been some discussion of a mechanism for selecting one of

    > several static tables at the start of a connection.  In that case, the spec

    > would probably define three tables (client headers, server headers [for

    > servers that don't push], combined [for servers that push]) and enable future

    > RFCs to define others for targeted scenarios (proxies, video playback, IoT,

    > etc.).  How much does that interest folks?



    I think it could be a good solution. We could also think about APIs and

    various datacenter-oriented use cases (eg: webservice etc) where very fast

    response and network efficiency matters. It could be a way to encourage

    QUIC adoption inside the DC. The risk however is that tables defined too

    late are never deployed due to interoperability concerns (unless there's

    a way to know that it will be supported before encoding). Thus if some

    participants are interested in optimizing for certain use cases, they should

    probably provide their own tables to be merged into the standard from day 1.



    Cheers,

    Willy






Received on Thursday, 24 May 2018 18:21:50 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:15:21 UTC