Re: #38 - HTTP2 min value for server supported max_concurrent_streams

William Chan (陈智昌) <willchan@chromium.org> Tue, 26 February 2013 16:30 UTC

Return-Path: <ietf-http-wg-request@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 (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4CE7E21F88A0 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 26 Feb 2013 08:30:48 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.449
X-Spam-Level:
X-Spam-Status: No, score=-9.449 tagged_above=-999 required=5 tests=[AWL=0.227, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, MIME_8BIT_HEADER=0.3, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZFjdXxnW6DND for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 26 Feb 2013 08:30:46 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id A82F321F88ED for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 26 Feb 2013 08:30:40 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1UANPf-0004AS-OI for ietf-http-wg-dist@listhub.w3.org; Tue, 26 Feb 2013 16:29:55 +0000
Resent-Date: Tue, 26 Feb 2013 16:29:55 +0000
Resent-Message-Id: <E1UANPf-0004AS-OI@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <willchan@google.com>) id 1UANPU-00046n-Cr for ietf-http-wg@listhub.w3.org; Tue, 26 Feb 2013 16:29:44 +0000
Received: from mail-qe0-f42.google.com ([209.85.128.42]) by maggie.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <willchan@google.com>) id 1UANPS-0003YU-J4 for ietf-http-wg@w3.org; Tue, 26 Feb 2013 16:29:44 +0000
Received: by mail-qe0-f42.google.com with SMTP id f6so2353985qej.1 for <ietf-http-wg@w3.org>; Tue, 26 Feb 2013 08:29:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=LpUIc3XQcuBjBPF9YYXWNxEoH/GLMn8tPiBh553uTt4=; b=CD7O3XibMjvEIOxCZLTaSTDfZUyKkK8Ewca0OibB/wrGS11YevxBB/VTAbt6xxSpG+ Hsx/fYMMl9IY31TyVHiD30bp6jbgwRCUUD3WSZ7H6dTk5Z0BM73lJCxiVln8LuehDY8S fGFzfJeVPPrsmdl1Ds0YNp6F+aAX8/dRvPxK5jwhQhtraWFw6a+/F3eH8XLzhTc96cXK X4XOGGnLHr7/sUYhI0xDerATXcXN5EyO6SCki/L9tvPW7y1LBrCS/2cPjIP2IITzWP4K vhoK48/F/zjxBxo26+fmPXeQ5ro7MQ8uFGhjSt3Of3Z9UOoGI0T8Mc/TqmcSOXx+Gl8u 2cNw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=LpUIc3XQcuBjBPF9YYXWNxEoH/GLMn8tPiBh553uTt4=; b=kQic2E4I3bfT1ArZA9ZpJGdQrj5TK+zMhyQ+Orda/AczGtQNmGs73u0VQH6qPybdQZ GMEU8xshwTSjfzXZbsny7vXPgI6ro0lBlcNgeaY/oUE6g+/gu5XVfcOL3RAfjbQnEdqH iBXu4umMxkH13O9WQ/mxoLFzp6HLrooUWvpw0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=LpUIc3XQcuBjBPF9YYXWNxEoH/GLMn8tPiBh553uTt4=; b=M5fRCfAsBSfQ2svZo3aj+exWtcEWmI3gYun969/rYV9vYH9Y7v3kKSTvUw0AmvF2BP lychhGdU9QlGN8rVExO5guvk9ucKo4hzB/QftsBxLfNaYUi7zbMBHdCpE0dzqc7j+9Ka MJ21uOVPWemwnczr3KDV5dLMDhge96BVl+CDi8GKrI0MzLK/DO2JDWgcU/ismOLtNQQ+ 4g+pFUTzLlE2qhc7Gu4WLer8pTN88+IZv7XJI+OFqTA9ZXypcmnZQ/RRB7Dz5GxRMWwm WqOzmBc7l1ncYJIIkFV7jt+CaVygoJQLo62GreAkpSUtvsYCbJktwoFDfPayrL+nrisX NFWQ==
MIME-Version: 1.0
X-Received: by 10.224.180.212 with SMTP id bv20mr2844010qab.6.1361896156177; Tue, 26 Feb 2013 08:29:16 -0800 (PST)
Sender: willchan@google.com
Received: by 10.229.135.210 with HTTP; Tue, 26 Feb 2013 08:29:16 -0800 (PST)
In-Reply-To: <CAA4WUYgtOoNbgDCLsu08=q-C2i_uV6iHJd+L0kTE87Az3p1ggw@mail.gmail.com>
References: <B33F11E188FEAB49A7FAF38BAB08A2C001D31EBA@TK5EX14MBXW601.wingroup.windeploy.ntdev.microsoft.com> <7D5CB237-97F8-4C6C-93F4-79E2C42D0EFF@checkpoint.com> <CAP+FsNcpbpXP8yAtTa4PgUhSrBjERDULyrHeOdjh-c70Ccu3Gg@mail.gmail.com> <CABkgnnXHuO-rYJ0buBzpFdF=eBCj2Lq_RzCf8p2wsVHf3ZUsCA@mail.gmail.com> <1E0AFABE-9300-41B8-9E0D-5FFCDEA574F3@checkpoint.com> <CAA4WUYhCLv5vv9tnm9TbYGaF5do-BzKNmuHv17XJ_GM7zFwSaA@mail.gmail.com> <B33F11E188FEAB49A7FAF38BAB08A2C001D32B31@TK5EX14MBXW601.wingroup.windeploy.ntdev.microsoft.com> <CAA4WUYhTqzxLgrzoVGsKxbU=XqPgD=GexX0Mnq3m8HiZJSKBcw@mail.gmail.com> <B33F11E188FEAB49A7FAF38BAB08A2C001D34CA3@TK5EX14MBXW601.wingroup.windeploy.ntdev.microsoft.com> <CAA4WUYgtOoNbgDCLsu08=q-C2i_uV6iHJd+L0kTE87Az3p1ggw@mail.gmail.com>
Date: Tue, 26 Feb 2013 08:29:16 -0800
X-Google-Sender-Auth: s7nmuVR05PzwPpMsXz3P1q-zlKY
Message-ID: <CAA4WUYhmNjiU9Y0iw-hDrRg5DzT+a5AobS1XU4htR60OMJtTwg@mail.gmail.com>
From: "William Chan (陈智昌)" <willchan@chromium.org>
To: Osama Mazahir <OSAMAM@microsoft.com>
Cc: Yoav Nir <ynir@checkpoint.com>, Martin Thomson <martin.thomson@gmail.com>, Roberto Peon <grmocg@gmail.com>, "ietf-http-wg@w3.org Group" <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="20cf303b40c39c3e7104d6a328e3"
X-Gm-Message-State: ALoCoQmCAHYo5hljQlh+Z9VGBsJZpD/ekloUVolGesGM72Ecf/vbTon7k20ND9zfQIMfDPo37TTeY1gCISfZPBr2SXRZPO/hG6+R1Yb1ONP8aNH2Jpcs/I0kemoBvtisAaj0RuFgQ/hCN28Os19J90ZPZ+k/DiTmEMwdi7rk99p56AjPXORlN5VnR+eATehJt5AA4DXnzIJX
Received-SPF: pass client-ip=209.85.128.42; envelope-from=willchan@google.com; helo=mail-qe0-f42.google.com
X-W3C-Hub-Spam-Status: No, score=-3.8
X-W3C-Hub-Spam-Report: AWL=-2.338, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-0.704, SPF_PASS=-0.001
X-W3C-Scan-Sig: maggie.w3.org 1UANPS-0003YU-J4 50b90e1c2f5743e9bdd2635487327323
X-Original-To: ietf-http-wg@w3.org
Subject: Re: #38 - HTTP2 min value for server supported max_concurrent_streams
Archived-At: <http://www.w3.org/mid/CAA4WUYhmNjiU9Y0iw-hDrRg5DzT+a5AobS1XU4htR60OMJtTwg@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/16834
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>

On Tue, Feb 26, 2013 at 8:26 AM, William Chan (陈智昌)
<willchan@chromium.org>wrote:

> Thank you for continuing to raise this issue. I definitely think this is
> worth discussing. I've reflected a bit on what you and others have said. If
> I understand you correctly, you are primarily concerned with the races
> before limits can be negotiated, and would like to see them fixed. I've
> pointed out that the races existed in HTTP/1.X and still exist with things
> like GOAWAY. It sounds like you'd like to fix them. I'm OK with fixing them
> as long as they do not impose performance costs due to extra roundtrips to
> reach appropriate parallelism. I think we disagree on acceptable code
> complexity. We've already implemented this logic in Chromium and believe it
> not to be burdensome.
>
> So, on that point, I think we may agree to disagree and see how the rest
> of the working group feels.
>
> But, can we fix the race without imposing performance costs? Let's examine
> the cases:
> (1) Upgrade, where, assuming successful negotiation, the server begins
> HTTP/2 in response to the HTTP/1.1 request with the Upgrade header.
> (2) HTTPS negotiation via TLS-NPN style mechanism. Client speaks HTTP/2
> first.
> (3) Out of band discovery like DNS, and the client starts speaking HTTP/2
>
> In (1), the server speaks first and can send SETTINGS immediately. So
> respecting server limits is not a concern. Respecting client limits is a
> concern. I think this falls into your "handshake advertise" scenario. We
> could add a HTTP header for the relevant SETTINGS during the Upgrade. This
> way, the server can respect the client limits.
>
> In (2), the client speaks first, and will only respect server default
> limits, not server specified limits since the server hasn't had a chance to
> send them yet. It's conceivable we could add settings into the NPN
> handshake. I'm a bit concerned about stashing so much into that handshake,
> since we've also previously discussed expressing capabilities in the
> handshake (e.g: supporting WebSockets over HTTP/2). If we wanted to do
> something like this, we probably would need to convey such a requirement to
> the TLS WG. I'm hesitant.
>
> In (3), since there is no negotiation, only discovery via DNS mechanisms,
> we'd have to stash the settings in DNS as discussed previously, and
> probably sign it too.
>
> I'm open to discussing conveying SETTINGS via the negotiation/discovery
> mechanisms we have available, in order
>

On re-reading this, "open to discussing" sound rather presumptuous. Just
wanted to follow up to say it's not my intent to decide what can and cannot
be discussed :P I blame the early morning.


> to attempt to reduce complexity. If we can reasonably prevent races via
> conveying SETTINGS sooner, then great. But I still believe the defaults
> should be chosen so they do not impose performance costs due to roundtrips
> to raise the limits from a low default. As Patrick says, 8 is far too
> small. The default should be on the order of 100. It's very common to do
> large domain sharding to a CDN, and we should make sure we can handle that
> case with a single connection, rather than incentivizing web devs to
> continue to do domain sharding to achieve desired parallelism.
>
>
> On Tue, Feb 26, 2013 at 12:34 AM, Osama Mazahir <OSAMAM@microsoft.com>wrote:
>
>>  Internet Explorer has similar gymnastics.  However, I don’t think that
>> is just cause to reinvent the same problems again.****
>>
>> ** **
>>
>> In general, the problem we have is that one side initiates operations
>> without knowing the peer’s limits.  MaxConcurrentStreams is one example and
>> negative flow control bytecounts is another (i.e. where the receiver is
>> trying to advertise that it has small buffers but we shove data down its
>> throat and dictate that it “MUST be prepared to receive the entire amount”
>> [1]).****
>>
>> ** **
>>
>> Possible solutions include:****
>>
>> **1.       **Handshake Advertise: Advertise limits as part of
>> handshake/negotiation.  That way, upon session start each side knows the
>> other’s limit and can guarantee that it won’t violate it.  That way, we can
>> simplify all parts of the protocol that are dealing with limit-exceed cases.
>> ****
>>
>> **2.       **Defaults and minimums: In the spec we pick some defaults
>> and minimums so that each endpoint starts at a known initial state and each
>> endpoint can thus guarantee that it won’t violate the peer’s limits.  The
>> initial SETTINGS frame can grow those limits.  Thus, we can simplify/delete
>> all the limit-exceed handling.****
>>
>> **3.       **Don’t fix: Not really a “solution”.  We write pages of
>> protocol text describing the races, how to workaround limit-exceed cases,
>> code and test it, and put that burden on all future implementers.****
>>
>> ** **
>>
>> In short, I ask the WG to not summarily dismiss this issue.  We should
>> devote some energy to ensure that the protocol is robust by-design.****
>>
>> ** **
>>
>> [1] http://http2.github.com/http2-spec/#rfc.section.3.7.9.3****
>>
>> ** **
>>
>> ** **
>>
>> *From:* willchan@google.com [mailto:willchan@google.com] *On Behalf Of *William
>> Chan (???)
>> *Sent:* Friday, February 22, 2013 3:57 PM
>> *To:* Osama Mazahir
>> *Cc:* Yoav Nir; Martin Thomson; Roberto Peon; ietf-http-wg@w3.org Group
>>
>> *Subject:* Re: #38 - HTTP2 min value for server supported
>> max_concurrent_streams****
>>
>> ** **
>>
>> On Fri, Feb 22, 2013 at 3:45 PM, Osama Mazahir <OSAMAM@microsoft.com>
>> wrote:****
>>
>>   ****
>>
>> As Martin said, 1 seems overly restrictive.  ****
>>
>>  ****
>>
>> My major concern is not the value of the number, but that we have a
>> minimum value and the default be the same as the minimum.  Otherwise, we
>> leave the race hole open then we are just increasing complexity.****
>>
>>  ** **
>>
>> Do you feel like the complexity is that bad? In my experience, from
>> implementing SPDY, it is not.****
>>
>>  ****
>>
>>  1.       Client will have to track negative allowance (because it did
>> not know how many requests it allowed to send)****
>>
>>  ** **
>>
>> Isn't this easy? The client always has to track how many outstanding
>> streams it has in order to respect the limit.****
>>
>>  ****
>>
>>  2.       Server has to promise that RST_STREAM due to
>> max_concurrent_stream overflow did not have any side effects****
>>
>> o   The server should verb agnostic (i.e. GET vs POST) and just look at
>> some streamCount variable.****
>>
>> o   Otherwise, client will have to pend all non-idempotent requests
>> until it gets the SETTINGS frame from the server****
>>
>>  ** **
>>
>> Since RST_STREAM has an error code, this is easy to define.****
>>
>>  ****
>>
>>  3.       Client will have to resubmit the request into its queue to be
>> sent when the allowance opens up****
>>
>>  Clients already have to know how to do this due to the GOAWAY race.
>> They also have to handle this in HTTP/1.X today. For example, if we get an
>> error when reusing a persistent HTTP connection (e.g. TCP RST), we will
>> resend the HTTP request over a new connection.****
>>
>>  4.       If the “blind” request(s) (i.e. sent before client received
>> the SETTINGS frame) have entity-body then client****
>>
>> o   Must wait until the server’s SETTINGS frame before sending
>> entity-body OR****
>>
>> o   Be able to regenerate the entity-body when the “blind” request is
>> RST_STREAMed****
>>
>> §  This means the layer on top of client stack needs to be able to
>> handle a “retry” error and resubmit the entity-body OR****
>>
>> §  The client stack buffers all the entity-body, as it converts it into
>> DATA frames, until it knows that the request won’t get RST_STREAM due to
>> max_concurrent_stream****
>>
>> o   Or just blow up and complain to the user****
>>
>>  ** **
>>
>> Again, clients already have to handle this.****
>>
>>  ****
>>
>>   ****
>>
>> In general, I would prefer if we made HTTP/2.0 to not have such races to
>> begin with instead of piling on complexity to react to the races.****
>>
>>  ** **
>>
>> As someone with experience implementing a SPDY client, I do not believe
>> this is a big burden. If you believe it is, I would like to hear why.****
>>
>>  ****
>>
>>   ****
>>
>>  ****
>>
>> *From:* willchan@google.com [mailto:willchan@google.com] *On Behalf Of *William
>> Chan (???)
>> *Sent:* Friday, February 22, 2013 2:36 PM
>> *To:* Yoav Nir
>> *Cc:* Martin Thomson; Roberto Peon; Osama Mazahir; ietf-http-wg@w3.orgGroup
>> *Subject:* Re: #38 - HTTP2 min value for server supported
>> max_concurrent_streams****
>>
>>  ****
>>
>> We always have to examine what the choices end up being for which
>> parties. If servers end up limiting parallelism, or requiring roundtrips to
>> ramp up parallelism, then clients which want speed (browsers) will be
>> incentivized to simply open up more connections to bypass the low
>> parallelism limit or slow start.****
>>
>>  ****
>>
>> Overall, I think it's better to tolerate the minor suboptimality of
>> having servers RST_STREAM streams if they don't want so much parallelism,
>> rather than incentivize browsers to open more connections.****
>>
>>  ****
>>
>>  ****
>>
>>  ****
>>
>> On Fri, Feb 22, 2013 at 2:19 PM, Yoav Nir <ynir@checkpoint.com> wrote:***
>> *
>>
>>
>> On Feb 22, 2013, at 6:16 PM, Martin Thomson <martin.thomson@gmail.com>
>> wrote:
>>
>> > On 22 February 2013 05:18, Roberto Peon <grmocg@gmail.com> wrote:
>> >> Why 1?
>> >
>> > 1 seems a little restrictive, especially since 6 concurrent
>> > connections is the current expectation in many browsers.****
>>
>> Defaulting to 1 allows for a simple server that never has to handle
>> multiple concurrent streams, one that can be implemented with much fewer
>> lines of code, but is still compliant. Great for serving software updates,
>> large files, CRLs, etc. Not so great for web pages.
>>
>> Other servers will quickly raise the limit via a SETTINGS frame.
>>
>> Yoav****
>>
>>   ****
>>
>>  ** **
>>
>
>