Re: [hybi] frame length encoding

"Shelby Moore" <shelby@coolpage.com> Sun, 22 August 2010 08:41 UTC

Return-Path: <shelby@coolpage.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 1C6273A681B for <hybi@core3.amsl.com>; Sun, 22 Aug 2010 01:41:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.144
X-Spam-Level:
X-Spam-Status: No, score=-2.144 tagged_above=-999 required=5 tests=[AWL=0.455, 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 9YJooFjHvRTI for <hybi@core3.amsl.com>; Sun, 22 Aug 2010 01:41:42 -0700 (PDT)
Received: from www5.webmail.pair.com (www5.webmail.pair.com [66.39.3.83]) by core3.amsl.com (Postfix) with SMTP id 7D3763A6781 for <hybi@ietf.org>; Sun, 22 Aug 2010 01:41:42 -0700 (PDT)
Received: (qmail 1084 invoked by uid 65534); 22 Aug 2010 08:42:16 -0000
Received: from 121.97.54.174 ([121.97.54.174]) (SquirrelMail authenticated user shelby@coolpage.com) by sm.webmail.pair.com with HTTP; Sun, 22 Aug 2010 04:42:16 -0400
Message-ID: <9dffe328cf36cd4acddad3282208ae5b.squirrel@sm.webmail.pair.com>
In-Reply-To: <AANLkTi=RVA4GQTExr9wjLR5+jH7q8R42_MKFPnp0eQU9@mail.gmail.com>
References: <AANLkTimKbmcpgx8k0uXUWvCO=8w9pPrtV=3y4qh6363k@mail.gmail.com> <alpine.DEB.2.00.1008212037190.27211@tvnag.unkk.fr> <AANLkTinrsT+wV48nHvVW_1ChGYffkq7jisU2-PZnMyKg@mail.gmail.com> <alpine.DEB.2.00.1008212123460.27211@tvnag.unkk.fr> <20ef7ed5e135c57c1ee5a741658b9d98.squirrel@sm.webmail.pair.com> <1282423311.2014.6.camel@tng> <b09e8e740ef2b5b5ec3c85a5d9dcfd08.squirrel@sm.webmail.pair.com> <AANLkTikE8+oEbviWrPO=Pi+=CHSMnCD9KYmH8EMxMktw@mail.gmail.com> <1282435090.2014.12.camel@tng> <5628917d835c46121071f82037969615.squirrel@sm.webmail.pair.com> <AANLkTi=RVA4GQTExr9wjLR5+jH7q8R42_MKFPnp0eQU9@mail.gmail.com>
Date: Sun, 22 Aug 2010 04:42:16 -0400
From: Shelby Moore <shelby@coolpage.com>
To: Roberto Peon <fenix@google.com>
User-Agent: SquirrelMail/1.4.20
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] frame length encoding
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: shelby@coolpage.com
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: Sun, 22 Aug 2010 08:41:44 -0000

> On Sat, Aug 21, 2010 at 8:23 PM, Shelby Moore <shelby@coolpage.com> wrote:
>
>> > On Sat, 2010-08-21 at 16:59 -0400, John Tamplin wrote:
>> >> On Sat, Aug 21, 2010 at 4:57 PM, Shelby Moore <shelby@coolpage.com>
>> >> wrote:
>> >
>> >>          Can you simply rewrite
>> >>         one sector on disk and the memory manager remaps?
>> >>
>> >>
>> >> I haven't tried it personally, but I would suspect you could use
>> >> TCP_CORK, write a header, use sendfile to send a chunk of the file to
>> >> finish the frame, uncork, repeat until done.  I don't think there
>> >> would be any extra copying involved here, but you can't just issue
>> the
>> >> sendfile and go on to the next message, you need some thread that
>> will
>> >> queue up the next frame when it is ready.
>> >
>> > That is correct (and I have done this personally), you need multiple
>> > calls of the ZC API interleaved with the write of the chunk header.
>> > There is no copying of the data through the CPU just because it
>> requires
>> > multiple calls. And there is no reason you couldn't implement some
>> kind
>> > of writev() like API that lets you interleave copied and zero-copied
>> > data.
>> >
>> > And yes, multiple calls are more overhead than 1 call. but at 1 per
>> 4GB,
>> > it really is inconsequential.
>>
>> That is an extremely technical solution applicable to experienced
>> sysadmins.
>>
>> But WebSockets is supposed to be used also by web programming amateurs.
>> It is much easier for them to issue a single sendFile() call from PHP,
>> Perl, Ruby, etc., without all the fuss and low-level network stack API
>> synchronization.
>>
>
> No, that (amateur programmers) is not a requirement currently as I
> understand things.
> The expectation is that we develop the minimal featureset necessary to
> ensure a robust and hopefully efficient transport.
> There are different perspectives about what that featureset need be
> assuming
> competent professional programmers, and that is how you should be looking
> it
> it!
> -=R

My understanding is that the "amateur programmers" requirement was only
removed for those who process the protocol directly, not for those who use
WS in scripting applications such as Javascript in browser, PHP, Perl, etc
on server. Am I incorrect?

I would strongly disagree if we go against "amateur programming" in
scripting uses of WS.  I do agree with the elimination of "amateur
programming" requirement for protocol implementation programmers.