Proposal - Reduce HTTP2 frame length from 16 to 12 bits

Patrick McManus <mcmanus@ducksong.com> Tue, 28 May 2013 14:22 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 (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D7CD521F8EC1 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 28 May 2013 07:22:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.976
X-Spam-Level:
X-Spam-Status: No, score=-9.976 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p3ETe0Nief-u for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 28 May 2013 07:22:38 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 7ADEE21F8E76 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 28 May 2013 07:22:38 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1UhKlu-0006vu-9U for ietf-http-wg-dist@listhub.w3.org; Tue, 28 May 2013 14:21:06 +0000
Resent-Date: Tue, 28 May 2013 14:21:06 +0000
Resent-Message-Id: <E1UhKlu-0006vu-9U@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <patrick.ducksong@gmail.com>) id 1UhKlb-0006sb-IF for ietf-http-wg@listhub.w3.org; Tue, 28 May 2013 14:20:47 +0000
Received: from mail-oa0-f52.google.com ([209.85.219.52]) by lisa.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <patrick.ducksong@gmail.com>) id 1UhKlS-0001Co-4x for ietf-http-wg@w3.org; Tue, 28 May 2013 14:20:47 +0000
Received: by mail-oa0-f52.google.com with SMTP id h1so10147809oag.11 for <ietf-http-wg@w3.org>; Tue, 28 May 2013 07:20:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=Rdc0fFUnBncO/1mLDUN+munjGyT+/9UM37kCqLgaltw=; b=RdgIBV0gsz9x7HA/RBNb9jKwnWxBqYvexJjhTj4QVQmZCARpwtIYTyfjnz7zatI4Tc vxX7++dT4mmyzOEHcOd3V3MQPdEjvpxIzig4QsKjdaigFSZylcWrsrJtgquuABzD8FqE pD1Bt1sjone7+L9yKlweBC2Lz55tOhLoSMPBGRNrRZEQR/LYmaZtGpmJ7ZNqRK+9iCHK 1PyLXCJZjU9vXGY0XITQrxylaoDTYEq9SgMNhY1fBIqjegoLzXvyZO9/HOWvUNwgP1lS 2yneTo0eAW9kJoUdKljLAd8/tW7e5MQoz9ed/G1ibseviBpnv4ncxIHweXdwaZF9AKPk Pvag==
MIME-Version: 1.0
X-Received: by 10.60.131.104 with SMTP id ol8mr1263016oeb.104.1369750812031; Tue, 28 May 2013 07:20:12 -0700 (PDT)
Sender: patrick.ducksong@gmail.com
Received: by 10.76.105.230 with HTTP; Tue, 28 May 2013 07:20:11 -0700 (PDT)
Date: Tue, 28 May 2013 10:20:11 -0400
X-Google-Sender-Auth: vZxy-P_rL-_ebnYP9_sCmDHBnhQ
Message-ID: <CAOdDvNoAjiRSBv9ue6RgCQJ4wMNQcKBH2a8zVa4_96wbp=g8MA@mail.gmail.com>
From: Patrick McManus <mcmanus@ducksong.com>
To: HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="089e013cb85c95019f04ddc7f6be"
Received-SPF: pass client-ip=209.85.219.52; envelope-from=patrick.ducksong@gmail.com; helo=mail-oa0-f52.google.com
X-W3C-Hub-Spam-Status: No, score=-3.4
X-W3C-Hub-Spam-Report: AWL=-2.706, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001
X-W3C-Scan-Sig: lisa.w3.org 1UhKlS-0001Co-4x 7e9e8fa5eb1e72e069a86b9b360f1760
X-Original-To: ietf-http-wg@w3.org
Subject: Proposal - Reduce HTTP2 frame length from 16 to 12 bits
Archived-At: <http://www.w3.org/mid/CAOdDvNoAjiRSBv9ue6RgCQJ4wMNQcKBH2a8zVa4_96wbp=g8MA@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/18112
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>

Hi All,

I've been looking at a lot of spdy frames lately, and I've noticed what I
consider a common implementation problem that I think a good http/2 spec
could help with. I'm commonly seeing frames large enough to interfere with
effective prioritization. I've seen this from at least 3 different servers.

The HTTP/2 draft has a max frame size of 16 bits, which is a huge
improvement from spdy's 24. I propose we reduce it further to 12. (i.e.
4096 bytes).

The muxxed approach of multiple streams onto one connection done in HTTP/2
has great advantages, but the one downside of it is that it creates head of
line blocking problems between those streams dictated by frame granularity.
With small frames this is pretty manageable, with extremely large ones
we've recreated the same head of line problems that HTTP/1 pipelines have.
The server needs to  be able to respond quickly to higher priority events
(including cancellations) and once it has written a frame header to the
wire it is committed to the entire frame for how ever long it takes to
serialize it. IMO the shorter that time, the better.

Our spec can help implementations do the right thing here by limiting the
max frame size to 12 bits.

It takes 500msec to serialize 64KB at 1Mbit/sec... 125msec at 4Mbit/sec.
Those are some pretty notable task-switch times. Dropping the frame to 4096
cuts them to 32msec and 8 msec.. that's much more responsive, at the cost
of 120 extra bytes of transfer (< 1msec at 1Mbit/sec).

In general - the smaller the better as long as the overhead doesn't get to
be too large. At 8 in 4096 (~.2%) I think that's acceptable. Its roughly
the same overhead as a VLAN tag.

Obviously this makes a continuation bit for control frames absolutely
mandatory, but I think we're already in that spot with 16 bit frame lengths.

-Patrick