Re: [hybi] Technical feedback. was: Process!

Greg Wilkins <gregw@webtide.com> Sat, 30 January 2010 07:13 UTC

Return-Path: <gregw@webtide.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 259303A6805 for <hybi@core3.amsl.com>; Fri, 29 Jan 2010 23:13:39 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.24
X-Spam-Level:
X-Spam-Status: No, score=-2.24 tagged_above=-999 required=5 tests=[AWL=0.359, 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 C2N70DtrzYES for <hybi@core3.amsl.com>; Fri, 29 Jan 2010 23:13:37 -0800 (PST)
Received: from mail-yx0-f194.google.com (mail-yx0-f194.google.com [209.85.210.194]) by core3.amsl.com (Postfix) with ESMTP id 202373A6405 for <hybi@ietf.org>; Fri, 29 Jan 2010 23:13:36 -0800 (PST)
Received: by yxe32 with SMTP id 32so2375620yxe.5 for <hybi@ietf.org>; Fri, 29 Jan 2010 23:13:59 -0800 (PST)
Received: by 10.91.160.29 with SMTP id m29mr1857786ago.61.1264835638857; Fri, 29 Jan 2010 23:13:58 -0800 (PST)
Received: from ?10.10.1.11? (60-242-119-126.tpgi.com.au [60.242.119.126]) by mx.google.com with ESMTPS id 16sm1736729gxk.15.2010.01.29.23.13.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 29 Jan 2010 23:13:58 -0800 (PST)
Message-ID: <4B63DC2D.4090702@webtide.com>
Date: Sat, 30 Jan 2010 18:13:49 +1100
From: Greg Wilkins <gregw@webtide.com>
User-Agent: Thunderbird 2.0.0.23 (X11/20090817)
MIME-Version: 1.0
To: Maciej Stachowiak <mjs@apple.com>
References: <de17d48e1001280012i2657b587i83cda30f50013e6b@mail.gmail.com> <4B620B8F.6030706@gmx.de> <Pine.LNX.4.64.1001282217320.22053@ps20323.dreamhostps.com> <bbeaa26f1001281449q1a6e1813q3f537fe15a5a9d60@mail.gmail.com> <4B625733.2020907@webtide.com> <6.2.5.6.2.20100128225542.06fa8d68@resistor.net> <Pine.LNX.4.64.1001290817520.22020@ps20323.dreamhostps.com> <4B62C5FE.8090904@it.aoyama.ac.jp> <Pine.LNX.4.64.1001291134350.22020@ps20323.dreamhostps.com> <4B62E516.2010003@webtide.com> <5c902b9e1001290756r3f585204h32cacd6e64fbebaa@mail.gmail.com> <4B636757.3040307@webtide.com> <BBF3CE06-3276-4A7C-8961-7B3DDEE406D0@apple.com>
In-Reply-To: <BBF3CE06-3276-4A7C-8961-7B3DDEE406D0@apple.com>
X-Enigmail-Version: 0.95.7
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Technical feedback. was: Process!
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, 30 Jan 2010 07:13:39 -0000

Maciej Stachowiak wrote:
> Here's comments on some of the issues that did not seem to me to merit their own thread.
> 
> On Jan 29, 2010, at 2:55 PM, Greg Wilkins wrote:
> 
>> It was a little silly having to implement two framing mechanisms
>> when only one of them has an API to enable it's usage.
> 
> This is a little lame, but it will ultimately be fixed at the API level once we have a good way to represent binary data on the client side.

Note that there are uses for this protocol beyond javascript in browsers.
Improvements in the protocol should not have to wait for improvements in
just the js API.

Note also that the binary frame is more than capable of carrying the
UTF-8 data, so it could have been entirely possible to just have the
binary framing and not have the sentinel framing mechanism with
all it's associated injection and buffer overrun issues.


>> So if you look on the wire of cometd running over websocket,
>> it just looks like long polling.  We use the same /meta/connect
>> long poll message as a keep alive and as our ack carrier.
>>
>> We've saved 1 connection, which is great.   But I fear that
>> saving will be eaten up by the ability of application developers
>> to open any number of websockets.
> 
> Doesn't it also save you the need to potentially close and reopen the connection that would have been used for messages from the client to the server? It seems like proper full duplex is a significant win, especially over SSL where connection setup is very expensive.

No.  HTTP/1.1 keeps the connection open between long poll
requests.

long polling gives full duplex over two TCP/IP connections.


>> If we are not running in reliable message mode, then we don't
>> need to wait for a /meta/connect before sending a message
>> to the client, so we get a small improvement in maximal
>> message latency for current usage and a good improvement
>> for streaming usage.
> 
> Wouldn't you also get an improvement in throughput, and not just latency, for streaming since you no longer need to repeatedly send full HTTP headers?

For a few use-cases that are streaming large volumes of data that
is almost continuous will get greater throughput.

But for many many comet applications (eg chat, auctions,
monitoring), the events a far enough a part and small enough
that in most cases there is a waiting long poll and the
response fits in a single MTU.   For these use cases,
websockets only helps with the minority of events that
occur when there is not a long poll waiting, thus it
really only helps the maximal latency.


>> But as I've frequently said, it works ok, but it solves
>> few of my real pain points as comet vendor and it's
>> caused me more code/complexity not less.
> 
> I'm curious to hear about some of the pain points that you think are not addressed. You mentioned two (reliable message delivery and maintaining idle connections) and I think you're right that those should be addressed. Any others?

For the scaling of the web applications that I work with,
connections have often been the limiting factor.

Websockets have no limits on the number of connections
that an application can open, thus no limit on the
amount of server side resources that a client side
developer can requisition.

I've previously explained in detail how a widget vendor
might find some better performance by opening multiple
websockets, so that they get a greater share of the
bandwidth available from a server.   But that only
works if your the only one doing it.  Soon everybody
will be opening 4, 8, 16 connections etc.


working with load balancers and other intermediaries
that need out-of-band communication with the server
is another.



>> It's not provided any semantics that would allow
>> any cometd users to consider going directly to websockets
>> instead of using a comet framework.   Sure it makes sending
>> messages easy, but that is always easy. It does not help
>> for when you can't send messages or when connections drop
>> or servers change etc.   These are all the realworld things
>> that must be dealt with and ws makes this harder not easier.
> 
> What kind of changes do you think would make it more practical to use WebSocket directly rather than go through a framework?

I actually fear the opposite.

It's like every book on Ajax starts with a chapter about how to
program directly to XHR.  So app developers go off and program
directly to XHR and get them selves in all sorts of strife.
Any seasoned Ajax developer will always tell you to have some
kind of framework wrapping XHR.

The same is going to happen with websockets.  Programmers
are going to seee books/publicity about it and start using
it directly.   Websocket is really easy to use and they will
soon have working bidirectional applications.

But working bidirectional applications are easy even with
simple HTTP.    The hard thing is how to make an applications
that fail well, or handle a laggy intermittent mobile network,
or can cope with strange intermediaries etc.   Websocket
provides a solution for very few of the problems that you
get doing bidirectionality over HTTP.   So programmers are
just going to go out and make a whole bunch of crappy
applications that don't work well in the real world
and we'll be picking up the pieces for years to come.

regards