Re: Overhead of HTTP/2 Stream Management.

Roberto Peon <grmocg@gmail.com> Sun, 05 April 2015 23:53 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DE5E61ACE6B for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 5 Apr 2015 16:53:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.411
X-Spam-Level:
X-Spam-Status: No, score=-6.411 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, J_CHICKENPOX_26=0.6, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5WNpd3l9ukzJ for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 5 Apr 2015 16:53:05 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A1A7F1ACE6C for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sun, 5 Apr 2015 16:53:05 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1YeuJz-0001Ko-V1 for ietf-http-wg-dist@listhub.w3.org; Sun, 05 Apr 2015 23:51:19 +0000
Resent-Date: Sun, 05 Apr 2015 23:51:19 +0000
Resent-Message-Id: <E1YeuJz-0001Ko-V1@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.80) (envelope-from <grmocg@gmail.com>) id 1YeuJw-0001K7-Bh for ietf-http-wg@listhub.w3.org; Sun, 05 Apr 2015 23:51:16 +0000
Received: from mail-ob0-f180.google.com ([209.85.214.180]) by maggie.w3.org with esmtps (TLS1.2:RSA_ARCFOUR_SHA1:128) (Exim 4.80) (envelope-from <grmocg@gmail.com>) id 1YeuJv-0007Tl-1g for ietf-http-wg@w3.org; Sun, 05 Apr 2015 23:51:16 +0000
Received: by obvd1 with SMTP id d1so21300983obv.0 for <ietf-http-wg@w3.org>; Sun, 05 Apr 2015 16:50:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=wrQmiHuS5+RhoIItZO6eb6N1tGSaxxWn9W5zskDmz88=; b=Q6hjENgZOzVQMD9ens0y/IK544laOdEm57XSd5SU1O3F6tDH8K+BRsIk0LbJx2spuj 2jff91oQvn67lMT9Un8+fsT7svn5NWxMThoXoSUxoPgUK9ImNvYbdoLEXYYwruEgLIpV G6YyMldmAp71WkMk31J4H5CdJjNMgUlp5ZmiMDCJCaPXZHDDkxuQS1Qdz9q5/VBmjBRO C3TA46m7E0WVuAXXkT7vMWHVmmsBu7trs67H8zre74STqCSl+0I+JHkaTt4dXgeZa18X iAe+J3neWFRnTTQ8jXAH9lzOkW8Iu5aHnoN+SRLsKcCbWSo8SE4xWTIvEcPWwSCsKqVI b2Sw==
MIME-Version: 1.0
X-Received: by 10.60.85.98 with SMTP id g2mr15126901oez.74.1428277849179; Sun, 05 Apr 2015 16:50:49 -0700 (PDT)
Received: by 10.76.128.51 with HTTP; Sun, 5 Apr 2015 16:50:49 -0700 (PDT)
In-Reply-To: <CABb0SYQ4+6fJHrfLVvfs8yZMakuwqv17M_THyKauy=UcewQAmA@mail.gmail.com>
References: <CABb0SYTLVFYXymJ75TkNkku3oT5pRcSAahjq2HcD5gDLouskpA@mail.gmail.com> <20150405183651.GA11551@1wt.eu> <CABb0SYTSW+M1NjBAa_s7dcB56obj1nEbQmt5r6P7eStTBmTwHg@mail.gmail.com> <20150405185755.GD8875@1wt.eu> <CABb0SYR0wV1U5i2n=PbZd+BFTBntJFvzFD0DPPRVHXyJP=Oyqg@mail.gmail.com> <CAH_y2NF2NXdsLn3yK-1F9hkHw+yuMzMp2GnE3EN-ZCU2KDqv6A@mail.gmail.com> <CABb0SYQ4+6fJHrfLVvfs8yZMakuwqv17M_THyKauy=UcewQAmA@mail.gmail.com>
Date: Sun, 05 Apr 2015 16:50:49 -0700
Message-ID: <CAP+FsNe-fvK5WsoqcRwPKGxM42A-EOUXTpxBFUCR7c=dRJ4MOg@mail.gmail.com>
From: Roberto Peon <grmocg@gmail.com>
To: Max Bruce <max.bruce12@gmail.com>
Cc: Greg Wilkins <gregw@intalio.com>, "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="089e0111bc2cd74b83051302d9db"
Received-SPF: pass client-ip=209.85.214.180; envelope-from=grmocg@gmail.com; helo=mail-ob0-f180.google.com
X-W3C-Hub-Spam-Status: No, score=-6.5
X-W3C-Hub-Spam-Report: AWL=0.289, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, W3C_AA=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: maggie.w3.org 1YeuJv-0007Tl-1g 64aced091330cc4311e528198c2fc746
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Overhead of HTTP/2 Stream Management.
Archived-At: <http://www.w3.org/mid/CAP+FsNe-fvK5WsoqcRwPKGxM42A-EOUXTpxBFUCR7c=dRJ4MOg@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/29270
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

If that is true, then you may want to write up a server and client
implementation, test/deploy it in the real world, and the write up.submit a
draft.
-=R

On Sun, Apr 5, 2015 at 4:37 PM, Max Bruce <max.bruce12@gmail.com> wrote:

> Well, I proposed a HTTP/1.1 addition to Mark, that prevents HOL blocking &
> allows server pushing in HTTP/1.1, with 100% backwards compatibility, and
> relative ease to implement, and can even start HPACK without any direct
> protocol negotiations. TCP is in charge of ensuring that content gets where
> it needs to go, if that TCP is untimely closed, that's something the client
> just has to re-request. As for the connection/stream overhead, you can have
> only one case of initializing TCP, and zero stream overhead, using 1-2 HTTP
> headers, that allow server pushing and prevent HOL blocking if implemented
> on both client and server(and if not, prepare the responses for the client
> before they ask).
>
> On Sun, Apr 5, 2015 at 4:15 PM, Greg Wilkins <gregw@intalio.com> wrote:
>
>>
>> Max,
>>
>> I don't see much difference between the stream overheads of HTTP/2 vs the
>> connection overheads of HTTP/1.
>>
>> Both need open/close state kept and even in HTTP/1 that state is
>> moderately complex as you can be half closed in and/or half closed out; the
>> response can complete before the request; there are multiple sources of
>> events (application vs network) that can race on state changes; the server
>> has a requirement to reliably deliver a serialised event stream to the
>> application without duplicates or loopbacks.    Unless the server/client
>> keeps good atomic state on the open/closed status, then there are going to
>> be lost events and/or leaked resources.
>>
>> In jetty the vast majority of this state overhead is in common code used
>> by both HTTP/1 and HTTP/2.    This code used to be a lot simpler in older
>> versions of our HTTP/1 on server... but it was wrong code that missed many
>> edge cases when presented with fully asynchronous applications.   Closing
>> asynchronous streams is just complex and multiplexing changes that very
>> little. It just makes the network event stream look a little different and
>> some events are distributed to multiple listeners.
>>
>> cheers
>>
>>
>> On 6 April 2015 at 06:08, Max Bruce <max.bruce12@gmail.com> wrote:
>>
>>> The way HTTP works though, we don't need streams in such a conventional
>>> and TCP-like way. We only need multiplexed packets to carry data over, so
>>> just associate request/response pairs with an ID, and allow server push via
>>> server sending the request path in a header too. Why do we even need a
>>> frame structure? It's unnecessary overhead. Same with the virtual streams.
>>>
>>> On Sun, Apr 5, 2015 at 11:57 AM, Willy Tarreau <w@1wt.eu> wrote:
>>>
>>>> On Sun, Apr 05, 2015 at 11:45:53AM -0700, Max Bruce wrote:
>>>> > My thoughts is that you just don't use so much overhead. You don't
>>>> get rid
>>>> > of stream IDs, you just don't need so much complex things surrounding
>>>> it.
>>>> > Example: You append a header to HTTP/1.1 request, with a response ID,
>>>> > server responds with it. Server can push responses by sending a
>>>> unsent ID &
>>>> > request path in a header.
>>>>
>>>> You still need the stream IDs in the frames themselves so that you know
>>>> which stream each frame belongs to.
>>>>
>>>> Multiplexed systems always look simple at first, until you start to
>>>> implement them, cover the corner cases (eg: who closes first etc) and
>>>> you finally realize once everything is done how much your system looks
>>>> like tcp...
>>>>
>>>> There was an elegant (in my opinion) simplification in H/2 compared to
>>>> other systems, the stream IDs are always incremented until the largest
>>>> encodable ID is reached, which is where a new connection must be used.
>>>> I find this elegant because you don't need to keep track of IDs in use
>>>> vs available ones and it really simplifies a number of things (eg: no
>>>> risk to have late frames from an old stream using the same ID).
>>>>
>>>> It doesn't please me either to have to implement such a complex system
>>>> but I am absolutely convinced that it can hardly be simplified further
>>>> as long as we want non-blocking, multiplexed streams. I have already
>>>> implemented multiplexed streams in the past for some projects, and it
>>>> resulted in almost the same design (but more complex).
>>>>
>>>> Willy
>>>>
>>>>
>>>
>>
>>
>> --
>> Greg Wilkins <gregw@intalio.com>  @  Webtide - *an Intalio subsidiary*
>> http://eclipse.org/jetty HTTP, SPDY, Websocket server and client that
>> scales
>> http://www.webtide.com  advice and support for jetty and cometd.
>>
>
>