Re: [hybi] Call for interest: multiplexing dedicated for WebSocket

Simone Bordet <sbordet@intalio.com> Wed, 22 May 2013 20:41 UTC

Return-Path: <simone.bordet@gmail.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 11F9721F961B for <hybi@ietfa.amsl.com>; Wed, 22 May 2013 13:41:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.978
X-Spam-Level:
X-Spam-Status: No, score=-1.978 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, NO_RELAYS=-0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XbLNELK8vHPh for <hybi@ietfa.amsl.com>; Wed, 22 May 2013 13:41:34 -0700 (PDT)
Received: from mail-pb0-x22b.google.com (mail-pb0-x22b.google.com [IPv6:2607:f8b0:400e:c01::22b]) by ietfa.amsl.com (Postfix) with ESMTP id 0FF9821F8CE9 for <hybi@ietf.org>; Wed, 22 May 2013 13:41:33 -0700 (PDT)
Received: by mail-pb0-f43.google.com with SMTP id ma3so2106943pbc.2 for <hybi@ietf.org>; Wed, 22 May 2013 13:41:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=dUSXo1P2AwKj17gKzwAtxd3x1dD+nPUoJerk6Jup1HU=; b=yKrPtfRhrgbl5kKdlOb97tqw5bRSfwuIAPCOq7oybOSarwuak94s3VfCyKhEyDzwNW 41UxtnvfFje2DEGZjoF7W+1JvtozCCVlqdpXCHNy/eBCIOAQXCQ3rsYJq5KaSJUrNXIg 0gakz8ApLffIMfukUZEborwNbaYGsWoYUAGUkIq0JPLu9t/nSAPnazlUdLvr6lBDGWjD 2rXDXnhe3HQb+CeILMnYA3ZcTgA4Z/biQ9Gk1Gr5+GAkGobPa8djMdHpwSApSgW08Uvu 55MmpXvO5nD8L/Yhr86LtCI3h8hrIV++NVGM1HWh8iT7SHHBBz9kgYD8T//mvJKAlSbb 73lA==
MIME-Version: 1.0
X-Received: by 10.66.165.73 with SMTP id yw9mr10200531pab.25.1369255288965; Wed, 22 May 2013 13:41:28 -0700 (PDT)
Sender: simone.bordet@gmail.com
Received: by 10.68.103.129 with HTTP; Wed, 22 May 2013 13:41:28 -0700 (PDT)
In-Reply-To: <519D1D0E.5000905@callenish.com>
References: <CAH9hSJZxr+aG7GZa4f-dUOTGj4bnJ+3XxivUX4jei5CMyqN4LQ@mail.gmail.com> <CAH9hSJZUG1f+3Uk=t2=A5i4O9=wPvAisspM=pgmGEH9emTL9-Q@mail.gmail.com> <CAH9hSJZai_UuxW4O6mZcEJT2DJoURtLo16XNci1qkYVWv4HVdg@mail.gmail.com> <007501ce56f0$67f74080$37e5c180$@noemax.com> <519CD6A1.7080708@ericsson.com> <519CE075.4000106@tavendo.de> <CAM5k6X9WmO80hiQZ6_GqK66PAd3of=2ZRi9=VrWj52apA1+=5g@mail.gmail.com> <519D02E7.6040009@tavendo.de> <CAM5k6X8Z-JxrgTy3NAc-wC7zK_AfsWAhqzNKaEY_yZzmz=pZcQ@mail.gmail.com> <CACuKZqHYmF+-zECFrGsHqt0i91jHAzk9Az72=tva_kn=ra2pKA@mail.gmail.com> <519D1D0E.5000905@callenish.com>
Date: Wed, 22 May 2013 22:41:28 +0200
X-Google-Sender-Auth: 0PismNcTlzNM2n3UEYOSyoD1PiQ
Message-ID: <CAFWmRJ3-04eUqsme1mS-KTUir-KJagXnTDg7QWFzW6jquYuzmQ@mail.gmail.com>
From: Simone Bordet <sbordet@intalio.com>
To: Bruce Atherton <bruce@callenish.com>
Content-Type: text/plain; charset=UTF-8
Cc: "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] Call for interest: multiplexing dedicated for WebSocket
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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, 22 May 2013 20:41:35 -0000

Hi,

>>> On Wed, May 22, 2013 at 1:32 PM, John A. Tamplin <jat@jaet.org> wrote:
>>> Servers don't handle tons of long-lived connections very well
>>
>> On 22/05/2013 12:00 PM, Zhong Yu wrote:
>> Is that still true today? Recent server implementations all boast they can handle tons of connections.
>
>On Wed, May 22, 2013 at 9:31 PM, Bruce Atherton <bruce@callenish.com> wrote:
> Tons of short, HTTP Request/Response type connections. John is talking about long-lived WebSockets connections, the kind that might hang around for days, weeks, even months. It is a different problem.

Well I am not sure.
I have seen the TCP Linux stack collapsing due to usage of HTTP 1.0 by
a proxy. Opening and closing connections at a high rate it's a killer.
Long lived connections, on the other hand, not so problematic, at
least in my experience, so Zhong Yu's question still stand for me.

Another point not addressed by the article linked by Tobias is the
type of usage of the protocol.
The HTTP protocol has a typical 1 request followed by 10-200 requests
in a burst, that can be performed concurrently.
In a non-mux protocol (like HTTP/1.1) browsers open 6 connections, so
to serve the burst you need multiple "passes" at using those 6
connections, which leads to the well known ziggurat profile: 6 out,
pause, 6 out, pause, etc.
In SPDY, which is muxed, the 100 requests go out at once, with a flat profile.
Roberto Peon and us (Jetty) have showed demos where this effect is
*eye visible*. SPDY is faster than HTTP just because of mux
(http://webtide.intalio.com/2012/10/spdy-push-demo-from-javaone-2012/).

Now, HTTP has a semantic which benefits clearly from multiplexing.
Does this hold true for WebSocket, which does not have semantic, but
just framing ? I think it depends.
If you use WebSocket to transport HTTP (i.e. the opposite that
HTTP/2.0 is working on) then perhaps mux would be very important.
But if you use WebSocket for chat messaging, perhaps that's not that
important to have mux.
The difference here is between a request/response model versus a
messaging model.
The model changes the need for mux.

Since WebSocket does not define a model (just framing), perhaps mux is
less important.
Application protocols may implement mux if they need to.

> Think of it this way. Say your server can handle 10K simultaneous connections to serve web pages and it takes about 330ms to serve them.
> If every one of those opens a websocket connection, you'll need 30K WebSocket connections just to handle a single second of traffic.
> If on average the page is kept open for only an hour, that is 108M connections.

That's under the assumption that WebSocket connections are closed
after a "request", which is wrong.
WebSocket connections are persistent.
If you want to serve HTTP resources via WebSocket, you better open 1
connection per client (like SPDY does), and your server will only be
able to handle 10k clients at any time.
But then you'll need mux, or you go back to HTTP/1.1, just with a
different framing (WebSocket).

--
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.