Re: [hybi] Framing take IV

Maciej Stachowiak <mjs@apple.com> Wed, 04 August 2010 01:18 UTC

Return-Path: <mjs@apple.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 34C2D3A697D for <hybi@core3.amsl.com>; Tue, 3 Aug 2010 18:18:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.504
X-Spam-Level:
X-Spam-Status: No, score=-106.504 tagged_above=-999 required=5 tests=[AWL=0.095, BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hv3amPJXzlOH for <hybi@core3.amsl.com>; Tue, 3 Aug 2010 18:18:01 -0700 (PDT)
Received: from mail-out3.apple.com (mail-out.apple.com [17.254.13.22]) by core3.amsl.com (Postfix) with ESMTP id 4CEC53A67E5 for <hybi@ietf.org>; Tue, 3 Aug 2010 18:18:01 -0700 (PDT)
Received: from relay11.apple.com (relay11.apple.com [17.128.113.48]) by mail-out3.apple.com (Postfix) with ESMTP id 84E6FA15CBCC for <hybi@ietf.org>; Tue, 3 Aug 2010 18:18:30 -0700 (PDT)
X-AuditID: 11807130-b7ca5ae000007de4-1d-4c58bfe6ce87
Received: from elliott.apple.com (elliott.apple.com [17.151.62.13]) by relay11.apple.com (Apple SCV relay) with SMTP id 6F.A4.32228.6EFB85C4; Tue, 3 Aug 2010 18:18:30 -0700 (PDT)
MIME-version: 1.0
Content-transfer-encoding: 7bit
Content-type: text/plain; charset="us-ascii"
Received: from [17.151.86.255] by elliott.apple.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPSA id <0L6L00FU3SYU0A90@elliott.apple.com> for hybi@ietf.org; Tue, 03 Aug 2010 18:18:30 -0700 (PDT)
From: Maciej Stachowiak <mjs@apple.com>
In-reply-to: <Pine.LNX.4.64.1008040050040.5947@ps20323.dreamhostps.com>
Date: Tue, 03 Aug 2010 18:18:29 -0700
Message-id: <28A6543A-5CA6-42B7-8D2E-F5511EE20008@apple.com>
References: <AANLkTinyrDoG5d_Ur6HVRy=SgMPjLzJtpJ++Ye=1DQdj@mail.gmail.com> <Pine.LNX.4.64.1008040050040.5947@ps20323.dreamhostps.com>
To: Ian Hickson <ian@hixie.ch>
X-Mailer: Apple Mail (2.1081)
X-Brightmail-Tracker: AAAAAQAAAZE=
Cc: hybi@ietf.org
Subject: Re: [hybi] Framing take IV
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 04 Aug 2010 01:18:02 -0000

On Aug 3, 2010, at 5:53 PM, Ian Hickson wrote:

> On Wed, 4 Aug 2010, Greg Wilkins wrote:
>> 
>> I think that we have reasonable consensus on something like:
>> 
>>  +--------------------------------------------------+
>>  | frag(1) |unused(3) | opcode(4) |  Length(16)     |
>>  +--------------------------------------------------+
>>  |                      Data                        |
>>  +--------------------------------------------------+
> 
> Why would we have a fixed length field with fragmentation rather than a 
> variable length field?
> 
> If we can have a variable width length field, do we need to support 
> fragmentation in the first version? I could see an argument for supporting 
> fragmentation in the case of multiplexing, but without that it doesn't 
> seem to actually gain us anything.

I agree. I can't see any benefit to fragmentation over a variable-size length field for an initial version without multiplexing. If the variable-size length field is well-designed, then in the common case where the message size is small it will only cost one extra branch to read the length. In the rare case where the message size is large, a variable-size length is easier to deal with than reassembling fragments, and easier on the sending side too.

I'm not really persuaded we need multiplexing at all until I see data proving the benefits. Useful data would be:

- Average degree of multiplexing we could likely get in real Web applications, based on measured user behavior. I'd like to see this for at least two different Web apps from two different vendors to make sure we are not overtuning to a single vendor's setup.

- Concrete performance benefits of multiplexing over a single TCP connection vs. using multiple connections. I have yet to hear an answer that involves numbers and doesn't sound handwavey.

- Performance cost of implementing multiplexing at the application level compared to doing it at the protocol level (either in terms of more connections resulting and the actual cost of that, or in terms of additional overhead on the client side from using an iframe or shared worker or whatever to share the connection.)

I'm open to trading off simplicity for performance, but only if I see data backing up the performance claims. Every performance project should start with measurement.

Regards,
Maciej