Re: [hybi] Framing take IV [why fragment]

Dave Cridland <dave@cridland.net> Thu, 05 August 2010 14:06 UTC

Return-Path: <dave@cridland.net>
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 0C9C23A68DA for <hybi@core3.amsl.com>; Thu, 5 Aug 2010 07:06:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.466
X-Spam-Level:
X-Spam-Status: No, score=-2.466 tagged_above=-999 required=5 tests=[AWL=0.133, BAYES_00=-2.599]
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 TIS0v1FsCW4W for <hybi@core3.amsl.com>; Thu, 5 Aug 2010 07:06:49 -0700 (PDT)
Received: from peirce.dave.cridland.net (peirce.dave.cridland.net [217.155.137.61]) by core3.amsl.com (Postfix) with ESMTP id 4696A3A6B22 for <hybi@ietf.org>; Thu, 5 Aug 2010 07:06:49 -0700 (PDT)
Received: from localhost (localhost.localdomain [127.0.0.1]) by peirce.dave.cridland.net (Postfix) with ESMTP id 347A311680A0; Thu, 5 Aug 2010 15:07:19 +0100 (BST)
X-Virus-Scanned: Debian amavisd-new at peirce.dave.cridland.net
Received: from peirce.dave.cridland.net ([127.0.0.1]) by localhost (localhost.localdomain [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dlkZg6cMVxxv; Thu, 5 Aug 2010 15:07:17 +0100 (BST)
Received: from puncture (puncture [217.155.137.60]) by peirce.dave.cridland.net (Postfix) with ESMTPA id C08B5116809F; Thu, 5 Aug 2010 15:07:17 +0100 (BST)
References: <AANLkTinyrDoG5d_Ur6HVRy=SgMPjLzJtpJ++Ye=1DQdj@mail.gmail.com> <Pine.LNX.4.64.1008040050040.5947@ps20323.dreamhostps.com> <1280932393.7561.271.camel@tng>
In-Reply-To: <1280932393.7561.271.camel@tng>
MIME-Version: 1.0
Message-Id: <2286.1281017237.786534@puncture>
Date: Thu, 05 Aug 2010 15:07:17 +0100
From: Dave Cridland <dave@cridland.net>
To: Patrick McManus <mcmanus@ducksong.com>, Server-Initiated HTTP <hybi@ietf.org>
Content-Type: text/plain; delsp="yes"; charset="us-ascii"; format="flowed"
Subject: Re: [hybi] Framing take IV [why fragment]
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: Thu, 05 Aug 2010 14:06:51 -0000

On Wed Aug  4 15:33:13 2010, Patrick McManus wrote:
> On Wed, 2010-08-04 at 00:53 +0000, Ian Hickson wrote:
> >  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.
> 
> In the absence of fragmentation the sender must have the entire  
> message
> available in order to prefix the total length in the header - so it
> engages in store and forward instead of streaming behavior.
> 
> 
I think some of these are bad arguments.


> Benefits of streaming:
> 
> * Reduced memory consumption on the sender in cases where the  
> message is
> being "passed through". A service that does a large database query  
> is a
> good example here - the results can be passed back as they are found
> even before you know how many there are.
> 
> 
No, because the receiver cnnot process portions of messages - at  
least with our current API. And you can achieve this behaviour by  
sending multiple messages anyway.


> * overall transfer time is reduced when the data to be sent takes  
> time
> to generate. Again, consider the DB query example. the transfer  
> time for
> the initial records is overlapped with the "think time" of the whole
> transaction. Instead of the total send time being "processing + bulk
> transfer" it is max (processing + network latency, bulk transfer)
> 
> 
This is true, but again, you can do this by sending multiple messages.


> * the receiver can overlap decompression with the receipt of  
> streamed
> chunks instead of adding decompression as a store-and-forward step  
> onto
> the end. (because without chunking the server cannot begin to send  
> the
> document until the whole thing is spooled). This will improve  
> effective
> message transfer time up to the JS layer.
> 
> 
Again, multiple messages.


> * better latency properties to the recving ws stack. Other APIs  
> than the
> anticipated JS one may make use of that at no cost to the JS one.
> 
> 
Likewise.


> And of course, as you say, fragmentation allows multiplexing and
> effective prioritization of flows by the sender.

This is true, in part.

The main reason I'd like to see fragmentation supported is to allow  
us to have a fixed-width length field, without having a maximal  
message length.

I would expect messages to be usually a single frame, and only larger  
when they couldn't be squeezed in or logically broken up.

Dave.
-- 
Dave Cridland - mailto:dave@cridland.net - xmpp:dwd@dave.cridland.net
  - acap://acap.dave.cridland.net/byowner/user/dwd/bookmarks/
  - http://dave.cridland.net/
Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade