Re: Straw Poll: Restore Header Table and Static Table Indices

Greg Wilkins <gregw@intalio.com> Wed, 15 October 2014 02:41 UTC

Return-Path: <ietf-http-wg-request@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CE02E1A0197 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 14 Oct 2014 19:41:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.065
X-Spam-Level:
X-Spam-Status: No, score=-7.065 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.786, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Yw4xvJzujTpL for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 14 Oct 2014 19:41:19 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9EBB81A0194 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 14 Oct 2014 19:41:19 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1XeETG-0007ob-QF for ietf-http-wg-dist@listhub.w3.org; Wed, 15 Oct 2014 02:37:50 +0000
Resent-Date: Wed, 15 Oct 2014 02:37:50 +0000
Resent-Message-Id: <E1XeETG-0007ob-QF@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <gregw@intalio.com>) id 1XeETA-0007nq-7Q for ietf-http-wg@listhub.w3.org; Wed, 15 Oct 2014 02:37:44 +0000
Received: from mail-wi0-f175.google.com ([209.85.212.175]) by maggie.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <gregw@intalio.com>) id 1XeET8-0003gl-EM for ietf-http-wg@w3.org; Wed, 15 Oct 2014 02:37:44 +0000
Received: by mail-wi0-f175.google.com with SMTP id d1so11668082wiv.8 for <ietf-http-wg@w3.org>; Tue, 14 Oct 2014 19:37:15 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=aTYsPJ8fCJXjkxHM3uym+VG8plL8GGdvUlgqeVROLRw=; b=YavdGuSJIKv/XUQTaaj3l79fW7cIPfUEjfiCL4ofkGbsrfRoYVYVW3fFhdzmXjTn0s /sLbdzracjB2vJeAGwDZO/6Jo6onyjXSCrns8gpKwq2RKTMLvZVheQq7uq+APBCdVjcB 44Fw4GCXZ2YrI2926vabWgZCPWSGNkqHX2pguHFY4W6g+VQqvHeCcknOFOz9fjzLg4zC j4soFOHiPahkSvW9eDUpjJhjYE8t6CBrrV5Utl0ot7Z8gmMNfJ2LnxKPzOYAvm+Frqi1 h4MzSR/xGYbIj2t1El4mz0B4PyuKwz5Yy51Lsj583MQoJqIgLI9M3EY2GiPH0MAHJkVH hfIA==
X-Gm-Message-State: ALoCoQn0B5YfyEaiq4Pm863Pz+a6HvBaQcbrXGj5QDDmB2SL6/KtGcDYc6CZPcqPujm1/JQa/2fa
MIME-Version: 1.0
X-Received: by 10.194.236.200 with SMTP id uw8mr9284333wjc.50.1413340635839; Tue, 14 Oct 2014 19:37:15 -0700 (PDT)
Received: by 10.194.164.168 with HTTP; Tue, 14 Oct 2014 19:37:15 -0700 (PDT)
In-Reply-To: <CAP+FsNci+YbQ9fP9LiJ1BBUSDryWOqi4A4YsKyORskY7pK0Fmg@mail.gmail.com>
References: <CA+pLO_jkN67HLT7oup+FcYVY+RZ7ckhpY2gGy=TAsr2UUMnVVA@mail.gmail.com> <987FB86A-EF8B-4CD1-A9A7-52A9163E8CB3@mnot.net> <EBB30C88-7EBD-400F-9591-B646B4D3687B@mnot.net> <CAP+FsNeJU6aciA+UV3sQ318e4=fXxv9zZbsDZ1jXmYstz6XwaQ@mail.gmail.com> <E465C1C7-20DF-4F78-9936-9C914042920A@mnot.net> <20141013012326.GD13217@1wt.eu> <CAP+FsNci+YbQ9fP9LiJ1BBUSDryWOqi4A4YsKyORskY7pK0Fmg@mail.gmail.com>
Date: Wed, 15 Oct 2014 13:37:15 +1100
Message-ID: <CAH_y2NEfOXWRtEbO+uUCKroW+NPGtyjqxNan3p5G+uFzuxxnCA@mail.gmail.com>
From: Greg Wilkins <gregw@intalio.com>
To: Roberto Peon <grmocg@gmail.com>
Cc: Willy Tarreau <w@1wt.eu>, Mark Nottingham <mnot@mnot.net>, HTTP Working Group <ietf-http-wg@w3.org>, Jeff Pinner <jpinner@twitter.com>
Content-Type: multipart/alternative; boundary="089e01493f608bf5bd05056d0294"
Received-SPF: permerror client-ip=209.85.212.175; envelope-from=gregw@intalio.com; helo=mail-wi0-f175.google.com
X-W3C-Hub-Spam-Status: No, score=-4.7
X-W3C-Hub-Spam-Report: AWL=-2.128, BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7
X-W3C-Scan-Sig: maggie.w3.org 1XeET8-0003gl-EM db47a014f720d4dbd328017bc877e65f
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Straw Poll: Restore Header Table and Static Table Indices
Archived-At: <http://www.w3.org/mid/CAH_y2NEfOXWRtEbO+uUCKroW+NPGtyjqxNan3p5G+uFzuxxnCA@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/27601
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On 15 October 2014 04:17, Roberto Peon <grmocg@gmail.com> wrote:

> One byte more overhead is significant when the amount of overhead was
> typically one byte to begin with,
>

Well if looked at in that way, removing the reference set was an increase
of 0 bytes to 1 byte for many headers, so an infinite increase in size.
Yet when looked at overall, the impact was negligible.

I agree that we need good efficient compression for dynamic headers, and am
willing to consider changes to ensure we get the balance right (such as
reducing the static table).  But I think that switching the index's back
adjusts the balance too far away from the very common use case of static
headers and static header names.

Here are my numbers for the test data run with h2-14, then removing the
suggested static headers (except Date), then adding in the suggested static
values:

  *size* *H2-14* *reduced* *values*  0 63.50% 64.40% 62.10%  4096 34.50%
34.20% 33.50%  8192 33.20% 32.70% 32.60%  12288 33.30% 32.60% 32.50%
So for the test data, reducing the static table size has hardly any affect
and by adding in values, the effect is often slightly positive.    So such
a change looks to at least do no harm.     Question is, does it do any good
for lots of dynamic headers - I'm happy to try answer that, but can do so
only if somebody can give me some test data to run against.


The worst possible impact of this means that one cannot bit-blit a large
> number of static headers-- one must add them one at a time or fix them up.
>

Not just static headers, but dynamic headers that use static names.


> I'll bet that I can show that this makes almost zero difference in CPU
> when implemented properly (there is little magical about a bit-blit to
> begin with)-- I'd be shocked if we couldn't do 100s of millions of
> header-sets per second on a single core.
>

While I'm sure that dedicated code can be written to generate h2 headers
very quickly, the reality is that servers are not written to be dedicated
to h2.   The fast bulk of the header generation and handling code is
written protocol neutral and has to work for  http, spdy, h2, fastcgi,
etc.   In that environment we have found it extraordinary difficult to
introduce header pre-generation when the bytes generated are a function of
the connection and sequence that the header will be sent.   For example, we
regenerate headers when we move a static resource into the cache, which is
done without reference to any particular protocol or connection.      While
the actual operation of customising a header for a particular connection
might just be a lookup and an add, there is a lot of complexity required to
work out when and if this addition is needed and bringing all the required
information to the correct point in the code.

I know this is a specific example, but I am sure that in general far better
and simpler optimisations can be done with encodings that are immutable
rather than with ones that are a function of connection and time.

regards








-- 
Greg Wilkins <gregw@intalio.com>  @  Webtide - *an Intalio subsidiary*
http://eclipse.org/jetty HTTP, SPDY, Websocket server and client that scales
http://www.webtide.com  advice and support for jetty and cometd.