Re: Reprioritization - implementation intent

Yoav Weiss <yoav@yoav.ws> Tue, 28 July 2020 06:45 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 (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 036DB3A0CE1 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 27 Jul 2020 23:45:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.918
X-Spam-Level:
X-Spam-Status: No, score=-2.918 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yoav-ws.20150623.gappssmtp.com
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 FIyaBhVna4F7 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 27 Jul 2020 23:45:09 -0700 (PDT)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8D87D3A0CDD for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 27 Jul 2020 23:45:08 -0700 (PDT)
Received: from lists by lyra.w3.org with local (Exim 4.92) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1k0JJv-0002uX-S1 for ietf-http-wg-dist@listhub.w3.org; Tue, 28 Jul 2020 06:42:40 +0000
Resent-Date: Tue, 28 Jul 2020 06:42:39 +0000
Resent-Message-Id: <E1k0JJv-0002uX-S1@lyra.w3.org>
Received: from mimas.w3.org ([128.30.52.79]) by lyra.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <yoav@yoav.ws>) id 1k0JJt-0002tm-Pi for ietf-http-wg@listhub.w3.org; Tue, 28 Jul 2020 06:42:37 +0000
Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by mimas.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <yoav@yoav.ws>) id 1k0JJq-0005AD-Af for ietf-http-wg@w3.org; Tue, 28 Jul 2020 06:42:37 +0000
Received: by mail-lf1-x134.google.com with SMTP id j22so4487627lfm.2 for <ietf-http-wg@w3.org>; Mon, 27 Jul 2020 23:42:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoav-ws.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cLlunsTwnvCpOool9xhSR6nvD/5J3GkBezQEtkQM5FY=; b=GDLpT+R630JOXxQuOGkzUCjwydJbNhty/pxCfUbMc2LdZ6C0haD2Xz8SKbioDWeSYA QI/wnL8yHxsAwEUwtFzliU01kRshwA1VDBiDao/9WZdTgCuvN/7xK3lVikIixorPOwcJ 82Pi7MbQ/9PkLVAlXcBOLESgYeRaC1wHH2uHC2Z8/7ljPmv7489XnOlgNTAQXofT8Xvi 8LRH4NAkPVjCTLAzF6x2zOYW0dE1sN5t/vgJpPX4LKdDNtClJQLZSykt2p3eV6Z+BLPX 7IZm+syrkI1KW3PZELyvwmdmPFLlchogA1+D6+Td1DFcQuAs1/Ka0p1E/mfGTbZuIIl2 0kcA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cLlunsTwnvCpOool9xhSR6nvD/5J3GkBezQEtkQM5FY=; b=bC+YsF0amXpXA3nBzoV0ugiq5A314khct5SX16o8ai8/rS7DVDmZqLgt6hrPSre1ts aQYd67G8VuwzHYP56Nv6G1upY25WZPDEWYyvSBlSwVwnPi9ZPp9osblzSeURqK4anBjc KdNHY8dmRktBkx/7/Mx8wedvQEJ0JwtkFV9mTwUOOytCD1j0+PC0GB7WkUkX4Rn3zkNg ZcNnoUIcsf6w0WNeS89tpSAIwRnMq51DfPZS1PHquJmcWC9wYRIQmKkqLb+4bAKgpd71 nA0lbXp6tfD/wRigUZhhNWT4e4sQXhDNElRkttESmnxi0LRFmcmzSIsqRRFd8N8qBpGi smUg==
X-Gm-Message-State: AOAM531dsm/GpZnHWazhwna0T5G5mPGWBgKQSTbDVTQx/ZC86Smsm492 IAQ6WcCAadFGpB3sApqR2tVFimBWLilss973f5O3sw==
X-Google-Smtp-Source: ABdhPJzlUrJFwlkK5cJLNJBl/lFnl1+vrYMasa5v1dFmtB4GIflgs9b+6sPno4+3xx9dUzy/xHCizJHdONneeR4oL+M=
X-Received: by 2002:a19:2388:: with SMTP id j130mr13463574lfj.190.1595918542233; Mon, 27 Jul 2020 23:42:22 -0700 (PDT)
MIME-Version: 1.0
References: <CALGR9obRjBSADN1KtKF6jvFVzNS1+JzaS0D0kCVKHKkd4sn+MQ@mail.gmail.com> <459C86F8-A989-4EF4-84DC-3568FF594F36@apple.com> <CANatvzwSpSHd7kZD-4tyMGkBJDdCBi6r_pLBvnaT8rrQy6SBHQ@mail.gmail.com> <CACMu3treK0m2mbpw9FebOjOcEed0bW-DbLbryHJH1DWAHoz+9g@mail.gmail.com> <CAJV+MGy2CytgPVEwEO3nDfpZ6h9+CCL-bODk=65cXexvS3N7Lw@mail.gmail.com> <CALGR9oYDApddLFzXv180TEXpmTaOpDCDNY41PxmbMJK7N4F4zQ@mail.gmail.com> <CAMWgRNaMZxph3zQv+O-SW7=PKBtDuGZNQ4+3X2geyXU545Vx9w@mail.gmail.com> <CAMWgRNaBAodWewpbi4cqFiMLWVd0SDnau7B4x0tjk+i=sMURpQ@mail.gmail.com> <CANatvzyQiNXY6xOYju8afe7-T6ZNMtQTPQE-AkfFK=2_yTzB1Q@mail.gmail.com> <CACj=BEhh+K=uMS613OsDFmvH18miNvm9m11M7QsL02Lc+JxUhg@mail.gmail.com> <CAJV+MGx3-cvPER2q1SPsgTbVP0TwAgPzNCQk_40dDPSr3JfkNg@mail.gmail.com> <CAJV+MGwXLoVe3RWPMCw9iJQ1Qr0TrJOezWq1VWOqrWYnBneQ4Q@mail.gmail.com> <CALGR9ob5E9ufzut7gZ37HwFvzeUb8mZYcyy=M3xKhS3hCCfyyw@mail.gmail.com> <4B9F6F51-4F0A-4A41-AA6D-2CB82A1B6531@mnot.net> <594BE12E-D3C4-454F-B7DB-FFF745DF536F@apple.com> <CACj=BEib86vLGQyvg+RWqX4EsDnwLGF6xxpSt6Y-WYF-M5zsxA@mail.gmail.com>
In-Reply-To: <CACj=BEib86vLGQyvg+RWqX4EsDnwLGF6xxpSt6Y-WYF-M5zsxA@mail.gmail.com>
From: Yoav Weiss <yoav@yoav.ws>
Date: Tue, 28 Jul 2020 08:42:06 +0200
Message-ID: <CACj=BEjH=DUDqgDO0rV8dNHW3x0P1HuRh4rgzp2Ok9xK16iq3g@mail.gmail.com>
To: Eric Kinnear <ekinnear@apple.com>, Ian Swett <ianswett@google.com>, Bence Béky <bnc@google.com>, David Schinazi <dschinazi@google.com>
Cc: Mark Nottingham <mnot@mnot.net>, HTTP Working Group <ietf-http-wg@w3.org>, Lucas Pardue <lucaspardue.24.7@gmail.com>
Content-Type: multipart/alternative; boundary="000000000000ccf7ad05ab7abd86"
Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=yoav@yoav.ws; helo=mail-lf1-x134.google.com
X-W3C-Hub-Spam-Status: No, score=-8.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1k0JJq-0005AD-Af ff7cfb7bab1b280a48a058f66d710046
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Reprioritization - implementation intent
Archived-At: <https://www.w3.org/mid/CACj=BEjH=DUDqgDO0rV8dNHW3x0P1HuRh4rgzp2Ok9xK16iq3g@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/37913
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: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

I ran the above by +David Schinazi <dschinazi@google.com>, who better
represents the Chrome networking team than me. His reply is: "Chrome will
closely follow proposals related to HTTP/3 reprioritization, and is very
likely to implement a proposal that gets consensus in the IETF QUIC Working
Group"

On Tue, Jul 21, 2020 at 9:06 PM Yoav Weiss <yoav@yoav.ws> wrote:

> +Ian Swett <ianswett@google.com> +Bence Béky <bnc@google.com>
>
> Google's Chrome and QUIC teams similarly intend to implement and support
> reprioritization, for similar use-cases.
> Upgrading images that are in or approaching the viewport as well as
> downgrading the priority of large downloads both seem like important use
> cases.
> Video streaming use-cases where either quality-tier change or user actions
> result in download changes also seem worthwhile (although I'm not sure if
> cancellation can't handle some of those).
>
> Another use-case I heard from folks is that of JS reprioritization as a
> result of user-actions: scripts that large apps want to download in
> low-priority can become critical as a result of a user-action that needs
> them. Being able to reprioritize can significantly impact such apps'
> responsiveness.
>
> On Tue, Jul 21, 2020 at 7:59 PM Eric Kinnear <ekinnear@apple.com> wrote:
>
>> Hi all,
>>
>> We (both in Safari and in URLSession for general HTTP usage on Apple
>> platforms) are quite excited about the new priorities document and the
>> opportunities it brings to simplify and focus on information that’s
>> strictly necessary to communicate between the client, server, and
>> intermediaries.
>>
>> Specific to reprioritization, we have several cases where we use, and so
>> far believe we need to continue to use, reprioritization (although ideas on
>> workarounds are always welcome!).
>>
>> First, the Web download case that’s been discussed (and thanks Patrick
>> for running some related experiments for web traffic!), where we use
>> reprioritization to modify the incremental bit on resources.
>>
>> Second, when streaming HLS video, we prioritize the currently playing
>> tier above the other tiers. We may have several requests outstanding for
>> the next several segments of video, and when we switch up/down we need to
>> be able to reprioritize those alternate tiers. Unfortunately, so far it’s
>> looking like not being able to reprioritize these requests would prevent
>> our implementation of the new priority scheme. For Low-Latency HLS, we
>> certainly will need to use reprioritization if we’re to fit within the
>> currently proposed priority tiers.
>>
>> Finally, a more generalized example. As we work to help customers and
>> clients of the APIs we offer, we’ve found that many of our efforts to guide
>> them towards appropriate prioritization of less important work at lower
>> priorities is only enabled by the ability to raise that priority later when
>> circumstances change.
>>
>> As a very contrived (but unfortunately close to real world) example,
>> consider a case where we ask a client to de-prioritize loading of images in
>> a list view that aren’t close to being scrolled into view by the user. If
>> we can offer higher priority for those images once the user starts
>> scrolling closer to having those items come into view, our clients are
>> generally happy to initially load such images at lower priorities. However,
>> if they’re stuck with that initial priority forever, they end up loading
>> the entire set of images at a high priority *just in case* they might be
>> eventually blocking render. A good bit of the time, that never happens, so
>> we end up having everything at high priority when in reality we would
>> rarely have needed to reprioritize the requests. And once everything’s at
>> high priority, we no longer have the utility of the priority system at all.
>>
>> There are all sorts of ways to dissect that particular example, but the
>> general response we’ve seen remains: folks are much more willing to fully
>> utilize a prioritization system in the real world if they’re able to adjust
>> the priorities that they assigned later on when they have more information
>> or the circumstances change.
>>
>> Thanks,
>> Eric
>>
>>
>> Side note:
>>
>> For the document as a whole, we’ve gotten some feedback internally that
>> it would be really nice if there were some (minimal, recommendation only)
>> guidance as to how to respond to the priority signals when received. This
>> wouldn’t be restrictive, as we’re really excited to experiment here and see
>> what awesome results we can achieve, but having a baseline of “implement
>> this as written and you’ll do *okay” *might be worth considering to
>> increase the likelihood that we have a large group of generally-performant
>> implementations.
>>
>> An example here would be if two requests of the same urgency arrive
>> back-to-back, the first with the incremental bit set and the second
>> without. What gets sent when? What do you do next if a third request
>> arrives with the incremental bit also set before the first is complete?
>> There are lots and lots of permutations, but a general approach of handling
>> new items coming in is something that I think we’ve all been imagining
>> during discussions, but we haven’t really written it down explicitly.
>> Internally, as we discussed with some folks new to the topic, we discovered
>> that our imaginations of what to do in cases like these didn’t actually
>> align as well as we thought.
>>
>>
>>
>> On Jul 9, 2020, at 11:46 PM, Mark Nottingham <mnot@mnot.net> wrote:
>>
>> All,
>>
>> Thanks to everyone for their efforts so far.
>>
>> There's one other aspect that the we think it'd be helpful to get a sense
>> of -- what the implementer intent is regarding reprioritisation.
>>
>> In particular, it'd be very helpful to have an indication from each
>> implementation -- in user agents as well as servers (including
>> intermediaries) -- as to how likely they are to produce/consume
>> reprioritisations if specified.
>>
>> Note that's per-implementation, *not* per-person, so please coordinate if
>> your implementation has multiple participants here.
>>
>> Responding to this e-mail is fine.
>>
>> Cheers,
>>
>>
>> On 7 Jul 2020, at 7:50 am, Lucas Pardue <lucaspardue.24.7@gmail.com>
>> wrote:
>>
>> Hi Patrick,
>>
>> Thanks for running this experiment and presenting the data back to the
>> group.
>>
>> Also thanks to the Chrome folk for enabling the disabling flag.
>>
>> Cheers
>> Lucas
>>
>>
>> On Mon, 6 Jul 2020, 21:19 Patrick Meenan, <patmeenan@gmail.com> wrote:
>> Sorry about the delay, just gathered the results.  The full raw results
>> are here.  It looks like the impact dropped quite a bit across the full 25k
>> URLs but looking at individual tests the impact is quite dramatic when it
>> does impact (and it does exactly what we'd expect it to do for those
>> outlier cases).
>>
>> The 95th percentile numbers tend to be the more interesting ones and in
>> the data set, reprioritization enabled is the control and disabled is the
>> experiment so positive changes means disabling reprioritization is that
>> much slower.
>>
>> Largest Contentful Paint: 4% slower without reprioritization
>> Speed Index: 2.75% slower without reprioritization
>> Dom Content Loaded: 1.3% faster without reprioritization
>>
>> This is pretty much (directionally) what we'd expect since
>> reprioritization boosts the priority of visible images (LPC/Speed Index)
>> above late-body scripts (DCL). It's particularly dramatic for pages that
>> use background images for any part of the page because they are discovered
>> after all other resources and would normally be scheduled after all other
>> scripts and inline images but if they are visible in the viewport the
>> reprioritization helps them load much sooner.
>>
>> Looking at a few examples of the extreme cases:
>>
>> https://www.thehelm.co/ - (Filmstrip) - The main background image in the
>> interstitial loads at < 10s vs 90s without reprioritization
>> https://blog.nerdfactory.ai/ - (Filmstrip) - The background image for
>> the main content loads at <5s vs 70s without reprioritization. No cost to
>> DCL, just prioritized ahead of not-visible images.
>> https://events.nuix.com/ - (Filmstrip) - Another hero background image
>> (detecting a theme?) loads at 10s vs 60s
>>
>> Looking at a few of the bigger DCL regressions:
>>
>> https://oaklandcitychurch.org/ - (Filmstrip) - DCL got much slower (11s
>> -> 33s) as a direct result of the background image moving from 30s to 10s
>> (the pop-up interstitial was delayed along with the scripts that control
>> it).
>>
>> For the specific case that most of these tests exposed (background image
>> discovered late by CSS) it is theoretically possible for Chrome to detect
>> the position before making the initial request (since it is only discovered
>> at layout anyway) but that wouldn't help any of the more dynamic cases like
>> when a user scrolls a page or a carousel rotates and what is on screen
>> changes dynamically.
>>
>> I'm still of the pretty strong opinion that we need reprioritization but
>> the web won't necessarily break without it and sites (and browsers) may be
>> able to minimize the impact of not being able to reprioritize (though that
>> might involve holding back requests and prioritizing locally like Chrome
>> does for slow HTTP/2 connections).
>>
>>
>> On Sat, Jun 20, 2020 at 10:17 AM Patrick Meenan <patmeenan@gmail.com>
>> wrote:
>> An early read on Yoav's Canary test is that most metrics are neutral but
>> Largest Contentful Paint degrades ~6.8% on average and 12% at the 95th
>> percentile without reprioritization and Speed Index degrades 2.6% on
>> average and 5.4% at the 95th percentile. This is not entirely unexpected
>> because the main use case for reprioritization in Chrome right now is
>> boosting the priority of visible images after layout is done.
>>
>> We'll see if it holds after the full test is complete. The early read is
>> from 3,000 of the 25,000 URLs that we are testing (all https hosted on
>> Fastly for simplicity since we know it handles HTTP/2 reprioritization
>> correctly).  The tests are all run at "3G Fast" speeds with desktop pages
>> to maximize the liklihood that there will be time for reprioritization to
>> happen.  I'll provide the full raw data as well as summary results when the
>> test is complete (at least another week, maybe 2).
>>
>> On Wed, Jun 17, 2020 at 5:43 AM Yoav Weiss <yoav@yoav.ws> wrote:
>>
>>
>> On Wed, Jun 17, 2020 at 9:55 AM Kazuho Oku <kazuhooku@gmail.com> wrote:
>>
>>
>> 2020年6月11日(木) 6:46 Kinuko Yasuda <kinuko@chromium.org>:
>> (Sorry, sent it too soon...)
>>
>> On Thu, Jun 11, 2020 at 6:12 AM Kinuko Yasuda <kinuko@chromium.org>
>> wrote:
>> Hi all,
>>
>> Reg: reprioritization benefit I can share some recent data for Chrome.
>> For the two cases that are currently discussed I'm actually not fully sure
>> about its benefit.
>>
>> For the renderer-triggered image reprioritization cases: this is a bit
>> interesting one, we recently found two things:
>> - Delaying to start low-prio requests could often work better (partly
>> because of server-side handling) than re-prioritizing while inflight
>> - In-lab measurements (tested with top 10k real sites, both on Mobile and
>> Desktop) showed that removing in-flight re-prioritization doesn't impact
>> page load performance a lot
>>
>> Let me stress though that testing this with servers that can properly
>> handle reprioritization could change the landscape, and again this isn't
>> really capturing how it affects long-lived request cases, or cases where
>> tabs go foreground & background while loading, so for now I'm not very
>> motivated to remove the reprioritization feature either.
>>
>> Hi Kinuko,
>>
>> Thank you for sharing your data. I feel a bit sad that reprioritization
>> isn't showing much benefit at the moment. I tend to agree that we are
>> likely to see different results between server implementations and HTTP
>> versions being used. The effectiveness of reprioritization depends on the
>> depth of the send buffer (after prioritization decision is made), at least
>> to certain extent.
>>
>> FWIW, I added a flag to turn off Chromium's H2 request prioritization. I
>> believe +Pat Meenan is currently running tests with and without this flag a
>> list of servers we estimate is likely to handle them well.
>>
>>
>>
>> I suspect this is maybe because server-side handling is not always
>> perfect and most of requests on the web are short-lived, and this may not
>> be true for the cases where long-running requests matter.  I don't have
>> data for whether may impact background / foreground cases (e.g. Chrome
>> tries to lower priorities when tabs become background)
>>
>> For download cases, Chrome always starts a new download with a low
>> priority (even if it has started as a navigation), so reprioritization
>> doesn't happen.
>>
>> Kinuko
>>
>>
>>
>>
>>
>>
>> On Wed, Jun 10, 2020 at 1:21 AM Lucas Pardue <lucaspardue.24.7@gmail.com>
>> wrote:
>> On Tue, Jun 9, 2020 at 4:27 PM Patrick Meenan <patmeenan@gmail.com>
>> wrote:
>> Eric's download example is a great one for exposing the risks that would
>> come for an implementation that supported prioritization but not
>> reprioritization.
>>
>> Take the trivial example of an anchor link that links to a download (say,
>> a 200MB installer of some kind):
>> - When the user clicks on the link, the browser assumes it is doing a
>> navigation and issues the request with the "HTML" priority (relatively
>> high, possibly non-incremental
>> - When the response starts coming back, it has the content-disposition to
>> download to a file.
>> - At this point, the 200MB download will block every other lower-priority
>> request on the same connection (or possibly navigation if it is
>> non-incremental)
>> - The user clicks on another page on the same site and gets nothing or a
>> broken experience until the 200MB download completes
>>
>> Without reprioritization the browser will effectively have to burn the
>> existing QUIC connection and issue any requests on a new connection (and
>> repeat for each new download).
>>
>> Implementing prioritization without reprioritization in this case is
>> worse than having no prioritization support at all.
>>
>> Thanks Eric for presenting this case, and Patrick for breaking it down.
>> That does seem like a pretty bad outcome.
>>
>> Is this a good candidate for a test case? IIUC correctly the problem
>> might occur today with HTTP/2 depending on how exclusive priorities are
>> used. I'm curious if browsers can share any more information about what
>> they do already. How does Firefox manage such a resource with it's priority
>> groups?
>>
>> Cheers
>> Lucas
>>
>>
>>
>> --
>> Kazuho Oku
>>
>>
>> --
>> Mark Nottingham   https://www.mnot.net/
>>
>>
>>
>>