Re: [hybi] hum #3: Message

Roberto Peon <fenix@google.com> Sat, 07 August 2010 19:38 UTC

Return-Path: <fenix@google.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 71D5B3A6880 for <hybi@core3.amsl.com>; Sat, 7 Aug 2010 12:38:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -101.855
X-Spam-Level:
X-Spam-Status: No, score=-101.855 tagged_above=-999 required=5 tests=[AWL=0.121, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, 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 rqz5b1h8K8Gx for <hybi@core3.amsl.com>; Sat, 7 Aug 2010 12:38:21 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.35]) by core3.amsl.com (Postfix) with ESMTP id A16893A6966 for <hybi@ietf.org>; Sat, 7 Aug 2010 12:37:42 -0700 (PDT)
Received: from hpaq7.eem.corp.google.com (hpaq7.eem.corp.google.com [172.25.149.7]) by smtp-out.google.com with ESMTP id o77JcDqK011257 for <hybi@ietf.org>; Sat, 7 Aug 2010 12:38:13 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1281209894; bh=DoBiru7U+Uk/h0XSmXKs9K2X2pA=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type; b=wF686k6dFJQZnmTVHwFRllrPIXq300iYK8Z8JRuIVJhpHT2aoNK05O2XAHBkds00X NH7rSxmZRzTIDaVEUQcRw==
DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:x-system-of-record; b=IBv5gjYd1qNH0LSstIY4yGWSUXVLgNCkf7pDb/U/Z6yFSG9ccunjXyRlROjK4LNzJ DC+VWvHUNcpOmX302Bwlw==
Received: from gyg10 (gyg10.prod.google.com [10.243.50.138]) by hpaq7.eem.corp.google.com with ESMTP id o77JcCNS032028 for <hybi@ietf.org>; Sat, 7 Aug 2010 12:38:12 -0700
Received: by gyg10 with SMTP id 10so3146330gyg.19 for <hybi@ietf.org>; Sat, 07 Aug 2010 12:38:11 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.151.62.21 with SMTP id p21mr15193181ybk.170.1281209891811; Sat, 07 Aug 2010 12:38:11 -0700 (PDT)
Received: by 10.150.59.4 with HTTP; Sat, 7 Aug 2010 12:38:11 -0700 (PDT)
In-Reply-To: <4C5DB23F.102@caucho.com>
References: <F8E2F702-9F74-4316-B3B2-D5A731409ABF@apple.com> <AANLkTin=gO9D8K5NVhqCRKki-jrDmTYqF-gBjp9X41GN@mail.gmail.com> <4C5BF15E.1090608@noemax.com> <AANLkTinXLPmBACd3ji0V9wkAWmxOR7qBMED19KKMvJrd@mail.gmail.com> <AANLkTi=RWdqDDgy24C6qtUSr+5R5p=P15B=+aUZuE16Q@mail.gmail.com> <4C5C07D6.1030208@noemax.com> <AANLkTimj9RvzL8E+FmH=vT_TeECVNmDPXY0ymPnvBHSZ@mail.gmail.com> <4C5C31DF.3030608@caucho.com> <2286.1281126409.976140@puncture> <4C5CBAEB.3050809@caucho.com> <20100807043359.GD4387@1wt.eu> <4C5DB23F.102@caucho.com>
Date: Sat, 07 Aug 2010 12:38:11 -0700
Message-ID: <AANLkTimCNQZUFS2b=dnW8bPsY-q6JkjuGkt-AsiNvrNL@mail.gmail.com>
From: Roberto Peon <fenix@google.com>
To: Scott Ferguson <ferg@caucho.com>
Content-Type: multipart/alternative; boundary="000e0cd58dc67bf165048d40ecf5"
X-System-Of-Record: true
Cc: Server-Initiated HTTP <hybi@ietf.org>
Subject: Re: [hybi] hum #3: Message
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: Sat, 07 Aug 2010 19:38:23 -0000

If we're going over TCP/IP, you may as well think about the overhead for the
TCP/IP headers.
It ends up coming down to transaction rate as much as anything else.
-=R

On Sat, Aug 7, 2010 at 12:21 PM, Scott Ferguson <ferg@caucho.com> wrote:

> Willy Tarreau wrote:
>
>> On Fri, Aug 06, 2010 at 06:46:19PM -0700, Scott Ferguson wrote:
>>
>>
>>> Any of 16/64, or 8/16/64 or 8/32/64 would be fine, but 8/64 is a poor
>>> choice for chunking because 256 bytes is too small to be a reasonable chunk,
>>> and 64 bits is a waste. Suppose you're using a 8k buffer. With the 8-bit
>>> length, you need 32 chunks just to send the buffer. With the 64-bit length,
>>> you're wasting 6 bytes. With those as the only options, you're stuck between
>>> two bad choices.
>>>
>>>
>>
>> You're wasting 6 bytes per 8kB, so less than 0.07%. It's even less than
>> the single byte you waste for 256 bytes (0.4%). The worst case is when
>> you send 2048 bytes. You waste exactly 8 bytes by either 8 8-bit chunks
>> or one 64-bit chunk, which in both cases represent 0.39%. But this is
>> still equal to the minimum 8-bit chunk overhead. So in fact if we wanted
>> to always have a lower overhead, we'd have to completely remove 8-bit
>> chunks, but I don't think that would be a good idea.
>>
>>
>
> Let's look at the full comparison between 8/64 and 16/64. The values in the
> table below are frame overhead for various message/chunk sizes (8-bit length
> is a 2 byte frame, 16-bit length is 3 bytes, and 64-bit length is 9 bytes):
>
>         8/64      16/64     64
>  --------------------------------
>  32      6.3%      9.3%     28.1%
>  128     1.6%      2.3%      7.0%   256     3.5%      1.2%      3.5%
>  512     1.8%      0.6%      1.8%
>  2048    0.4%      0.1%      0.4%
>  8192    0.1%      0.04%     0.1%
>
> (Note that 8/64 only beats 16/64 in the upper left.)
>
> Three ways of looking at the table:
>
>  a) optimal length given a priori knowledge of the message size
>  b) practical length given dynamic content. (When it's not known if a 32
> byte echo/print/write is the full message or the first part of a bigger
> message.)
>  c) chunking
>
> a) For optimal, it all depends on the message-length distribution. When
> messages are tweets, 8/64 is better (1.6% vs 2.3%). When messages are
> between 256 and 64k, 16/64 is better (0.6% vs 1.8% for a 512-byte message,
> and 0.15% vs 0.44% for the 2048-byte chunk example).
>
> b) For dynamic content, the upper-right table values are the problem. The
> 28.1% and 7.0% are more than they need to be. Even so, it's still probably
> not worth shifting the content. So the optimal 8/64 becomes a practical
> 64-bit fixed length because it's not worth the effort to repack the data.
>
> c) Chunks would be between 512 and 64k, depending on the implementation's
> buffer size. In that range, 16/64 is always superior. It's only the final
> chunk that might benefit from an 8-bit length.
>
> Even though 16/64 is a better choice overall (given dynamic-content
> pragmatic issues, chunking needs, and uncertainty about the real-world
> message-length distribution), 8/64 is workable. The 28% and 7% overheads in
> the upper right are inelegant, and the extra chunking overhead is less
> efficient, but it's workable.
>
> -- Scott
>
>
>  So all in all, I think that the 64-bit csize always offers lower overhead
>> than the 8-bit ones so it will always be more efficient above 2 kB than
>> anything sent in 8-bit blocks, and the overhead is still small.
>>
>> Regards,
>> Willy
>>
>>
>>
>>
>>
>>
>
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi
>