Re: Nit: Server-sent priority

Mike Belshe <mike@belshe.com> Wed, 19 June 2013 17:22 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 37FC221F9E4B for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 19 Jun 2013 10:22:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.976
X-Spam-Level:
X-Spam-Status: No, score=-9.976 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-8]
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 bxWfUIuzLwe5 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 19 Jun 2013 10:22:11 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 3F69321F9E15 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 19 Jun 2013 10:22:05 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1UpM4M-0005D6-2f for ietf-http-wg-dist@listhub.w3.org; Wed, 19 Jun 2013 17:21:18 +0000
Resent-Date: Wed, 19 Jun 2013 17:21:18 +0000
Resent-Message-Id: <E1UpM4M-0005D6-2f@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <mike@belshe.com>) id 1UpM47-000516-So for ietf-http-wg@listhub.w3.org; Wed, 19 Jun 2013 17:21:03 +0000
Received: from mail-bk0-f47.google.com ([209.85.214.47]) by maggie.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <mike@belshe.com>) id 1UpM46-0005s3-J6 for ietf-http-wg@w3.org; Wed, 19 Jun 2013 17:21:03 +0000
Received: by mail-bk0-f47.google.com with SMTP id jg1so2429475bkc.6 for <ietf-http-wg@w3.org>; Wed, 19 Jun 2013 10:20:36 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=+N4EaHJpjXd10C+yaotbglTJqCHzeik/SmKxjUtKhFA=; b=ZfvawwIx3IeZYn4yNhmgwtVU15o1TWArq+16ZAjzyk04zSZ1oyrue1Imj8DpTKT5E7 9jg76stOUmvR2mTY13iPO2jKwlcY4EkiHP6k7z7jhOTRC1qjeFeNSWpm/FEQWPBSFia9 89RxAQz1G16nEe2Zm+NNU9kUS5Xv/i6cI7GVU56/6UpHFwbJx/fLlSHf1h4kYmbLvET+ 355uLwhswdvVih4a+SYdGMwO9lNAtwaNIUrjViBn9qzjCk3gKP8Fqkrt/t4qDlXEbXLS Q9b801v+78dlTUyetYpciTgIASfQniwbLj/JQ5HJyOZPGUMWM8PbSpnLyGTr1XzMkAWa BVVg==
MIME-Version: 1.0
X-Received: by 10.205.132.201 with SMTP id hv9mr487485bkc.164.1371662435796; Wed, 19 Jun 2013 10:20:35 -0700 (PDT)
Received: by 10.205.14.130 with HTTP; Wed, 19 Jun 2013 10:20:35 -0700 (PDT)
In-Reply-To: <CAOdDvNqrnJ3P8uWZqmgX0nh0nuEKnX=SvgZ0mKpeSi1ZC51Txg@mail.gmail.com>
References: <CABkgnnUWPkqKQEfc3sm_7_nLFJVyDrvbKRVTFsUV19fRfrezzQ@mail.gmail.com> <CABaLYCv1TDtsRyWqUunwF7NOqfEpNU6h_osUKUvp1bxZFcXfAw@mail.gmail.com> <CABaLYCsKkNFUWujDHMo7G6+8MP-DEPqKC7=hXyp3N-=tfvNz8g@mail.gmail.com> <CAOdDvNqrnJ3P8uWZqmgX0nh0nuEKnX=SvgZ0mKpeSi1ZC51Txg@mail.gmail.com>
Date: Wed, 19 Jun 2013 10:20:35 -0700
Message-ID: <CABaLYCuJOvXKoEnBjpibCV1BGo1jHdCDpp7Kpk4Rs5EY=7+EGQ@mail.gmail.com>
From: Mike Belshe <mike@belshe.com>
To: Patrick McManus <pmcmanus@mozilla.com>
Cc: httpbis mailing list <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="047d7b6251ac3d062504df850cc5"
X-Gm-Message-State: ALoCoQnlRXGmOSbkgV/np0Noe00fuM0LHYOHUGyVUr2KsDTovew3pv5uPW7xwJ9HhlEYbaoCRm+L
Received-SPF: none client-ip=209.85.214.47; envelope-from=mike@belshe.com; helo=mail-bk0-f47.google.com
X-W3C-Hub-Spam-Status: No, score=-3.8
X-W3C-Hub-Spam-Report: AWL=-3.101, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7
X-W3C-Scan-Sig: maggie.w3.org 1UpM46-0005s3-J6 5969fc7f4d758fd05482ee3c182f005b
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Nit: Server-sent priority
Archived-At: <http://www.w3.org/mid/CABaLYCuJOvXKoEnBjpibCV1BGo1jHdCDpp7Kpk4Rs5EY=7+EGQ@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/18283
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 Wed, Jun 19, 2013 at 6:14 AM, Patrick McManus <pmcmanus@mozilla.com>wrote:

> The only use case I understand, in an HTTP context, for server sent
> priority is on a pushed stream. And in that case the priorities are
> distinctly not independent between the client and server initiated streams
> (though they all apply to the response body sender).
>

I actually don't see it this way.

The server is sending (pushing) at whatever priority it wants.  Since the
stream is half-closed to the client, there is no priority-hint necessary
from the client.



>
> In that case the client has to know the priority the sender is using on
> the new stream (and potentially change it) so that future streams initiated
> by the client can have their priorities set in a relative weigh.
>

I guess.  I suspect that in most cases, the push transfer is complete
before the client can react (either via sending a reprioritize or a new
stream and getting it across to the server).


>
> An example: the client requests index.html at priority 3, the server
> pushes img1 and css1. All three resources are still transferring and the
> client now wants to pull img2 and img3 at the same priority as img1 (which
> is still flowing) but a lower priority than css1. What priorities does it
> use in its requests? It can't get that right without knowing what priority
> the server has assigned to those pushes.
>

(note: I apologize for expanding this topic in my response - there are
several issues at play)


We're into massive speculation area here about what loads pages fastest.  I
searched high and low for prioritization schemes that were markedly better
than others.  I never found one (maybe someone on this list will!).  With
the vast variety of web pages out there, all the priority schemes ended up
averaging about the same, so long as you applied basic principles.  This is
why in the end, we just went with a simple prioritization hint and left the
rest up to the implementations.  Server push throws in a whole new monkey
wrench that we never were able to prove works all that well - you're
pushing content that the client had better not already have (so you don't
clog the channel) AND you better do it at the "right" time to not slow down
the page load.  The client's reaction time is at least a half-RTT away, so
by the time you notice you screwed up it is already too late.

My advice is to leave this part of the spec open ended to the implementors.
 Best practices will emerge as people use it.  Keeping the algorithms
simple on the client will have the best chance of consistent browser
behavior.  Imagine if one browser attempts to reprioritize push streams and
another does not?  Oh - the server side hacks will be monstrous :-)

If it were up to me, I would
   1. let the client should do some basic prioritization hints on stream
create that is known to be good
   2. do not let the client reprioritize, as it will lead to browser
variance and force the servers into browser hack mode.
   3. leave all remaining priority decisions to the server.  it will learn
over time, be able to optimize for specific cases, etc.

Mike





> Is there another use case here?
>
>
>
> On Wed, Jun 19, 2013 at 4:06 AM, Mike Belshe <mike@belshe.com> wrote:
>
>> Accidentally sent this only to Martin.
>>
>> Looks like James and I had the same answer.
>>
>> ---------- Forwarded message ----------
>> From: Mike Belshe <mike@belshe.com>
>> Date: Tue, Jun 18, 2013 at 5:09 PM
>> Subject: Re: Nit: Server-sent priority
>> To: Martin Thomson <martin.thomson@gmail.com>
>>
>>
>>
>>
>>
>> On Tue, Jun 18, 2013 at 3:42 PM, Martin Thomson <martin.thomson@gmail.com
>> > wrote:
>>
>>> We discussed the possibility that a server could send PRIORITY (either
>>> in its own frame or attached to HEADERS).  The idea was that the
>>> server could advise a client about the priority that it is applying,
>>> which might be different to the priority that a client requested.
>>>
>>
>> I am not sure how the client would use this information.
>>
>> The intent of priority was to indicate what order you'd like the other
>> side to process the streams.  If its a full-duplex stream (not likely
>> HTTP), the server and client can each assign a different priority to the
>> other side.
>>
>> They're just independent.
>>
>>
>>>
>>> This adds a challenge for clients: does the client now provide updated
>>> priorities that are relative to the priorities that it sent
>>> previously, or relative to the priority that the server has indicated?
>>>
>>
>> Indeed confusing - more reason not to do this :-)
>>
>>
>>>
>>> e.g., client sends three requests, priority 7, 10 and 15.  Server
>>> responds and indicates priorities of 3, 5 and 7.  If the client wants
>>> to issue a new request that is higher priority than the lowest
>>> priority existing request, does it indicate a priority of between 10
>>> and 15?  Or does it indicate a priority of 6?
>>>
>>
>> 10< pri <15
>>
>>
>>> This editor wants to know.  I think that the easiest approach would be
>>> to stipulate that the priorities spaces are independent and that
>>> client priorities are only relative to client priorities.
>>> Unfortunately, that means that I need to include the example above as
>>> well.
>>>
>>
>>
>>
>>>
>>> I don't want to prohibit servers from sending priority, because I
>>> believe that it could be useful for a client to understand how
>>> priority is being applied.
>>>
>>
>> I'm not sure how the client would use that information - dynamically
>> adjust?  This seems like a non-use case.
>>
>>
>> Mike
>>
>>
>>
>>
>>
>>
>