Re: Prefer-Push, a HTTP extension.

Amos Jeffries <squid3@treenet.co.nz> Sat, 24 November 2018 08:12 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 D4B78129385 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 24 Nov 2018 00:12:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.9
X-Spam-Level:
X-Spam-Status: No, score=-2.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, MAILING_LIST_MULTI=-1, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 kaun_DPUZ2pZ for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 24 Nov 2018 00:12:16 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [IPv6:2603:400a:ffff:804:801e:34:0:38]) (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 146E21252B7 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sat, 24 Nov 2018 00:12:15 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.89) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1gQT0M-0005lr-4r for ietf-http-wg-dist@listhub.w3.org; Sat, 24 Nov 2018 08:09:30 +0000
Resent-Date: Sat, 24 Nov 2018 08:09:30 +0000
Resent-Message-Id: <E1gQT0M-0005lr-4r@frink.w3.org>
Received: from titan.w3.org ([2603:400a:ffff:804:801e:34:0:4c]) by frink.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <squid3@treenet.co.nz>) id 1gQT0I-0005lA-2I for ietf-http-wg@listhub.w3.org; Sat, 24 Nov 2018 08:09:26 +0000
Received: from [116.251.193.116] (helo=treenet.co.nz) by titan.w3.org with esmtp (Exim 4.89) (envelope-from <squid3@treenet.co.nz>) id 1gQT0G-0005CL-Eu for ietf-http-wg@w3.org; Sat, 24 Nov 2018 08:09:25 +0000
Received: from [192.168.20.251] (unknown [121.98.44.108]) by treenet.co.nz (Postfix) with ESMTPA id 8105C6600CA for <ietf-http-wg@w3.org>; Sat, 24 Nov 2018 21:08:51 +1300 (NZDT)
To: ietf-http-wg@w3.org
References: <18d0e93b-67e1-cfed-5418-fd50594fc5f9@evertpot.com> <A1C8E610-7ECF-43A9-8159-72D1E03E6311@mnot.net> <9f39ff3d-fe37-14fb-5fb0-e03413d0316e@evertpot.com>
From: Amos Jeffries <squid3@treenet.co.nz>
Openpgp: preference=signencrypt
Autocrypt: addr=squid3@treenet.co.nz; prefer-encrypt=mutual; keydata= xsFNBFiOEzoBEADuuawHiMOqHBjL5Mk6IfPCgJmY3oqJDmykzve+vDh7jArtFnOG067ftaML ligGh3y6LOLh3r1kIZ254CPHuKFYssA1p9mXL9YJnZ1qHrQVhqZwDq7dH/UtBQ2IM1QukoTo 1VRTB3ppiPHKTSa2zZ/kgBs0d+1MOi8DY2SmIDYVhUJI55qSqpxlcs6MyG4KxlEPD35J3nL4 hIzLzuzIbZoUO6M+dLvnqiFu2+mm6o75nxYmq+JCPwN5biETkSvndqr56t/W0ajlU1MpFXfO YJ8PfutrIBUPsRJUqWQjGg6uXp4torC1q2XasfSKVIQ+8duw7MCrkAfRv5BtDtpesAAsScvY TwUaDYVioiNNK1uJQZlrpYY4I0EbHI4GHKq7Q4VmotcQ2BhigqRIdh7kD3corddhlLTvTs0G 5Pjk/T2ZoMF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1ZnkVANBo1KmE+Ycw92IMcz2ev4VFw+pbqZ/swHqa3y3L5cT7Keqgc67 wiahSZRc5zM0jJWxN//lpgcdnDRI1OSLCrMMI69yc2QMzUZu87BtEJzm0DBy2pIKEni9dSCw wMITUsU21Ny3RmaV7fmXYAyp9pcaQQWGOb2CIvU7k60eLWgfNTo5SGI56WYC+ndod7vPU+sw JVbKrQKqfwO5JbdY9YPbo++Z6kfrnbkmm3wkJ4W8dOcrkLYbmOk7sColcQhVbmGy74Ggzl75 R22Q7+Uhjj9iq0Kv3CGQ3rKVdXOfAo5OekdaMDx9t9HoirGiokcyCPTy7wAyvQ75lbrygxCm e05XBfLZHrMp+SdM8ONsdgIe7U0bI85zYegceSagzCtBdB8HQ10TFg==
Message-ID: <f8f79dd2-4e84-362f-0ba8-9d9546a5c8ed@treenet.co.nz>
Date: Sat, 24 Nov 2018 21:08:44 +1300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0
MIME-Version: 1.0
In-Reply-To: <9f39ff3d-fe37-14fb-5fb0-e03413d0316e@evertpot.com>
Content-Type: text/plain; charset="utf-8"
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-W3C-Hub-Spam-Status: No, score=-6.1
X-W3C-Hub-Spam-Report: AWL=1.033, BAYES_00=-1.9, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1gQT0G-0005CL-Eu 3427616dce8a55fc0f47bebb6ab05282
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Prefer-Push, a HTTP extension.
Archived-At: <https://www.w3.org/mid/f8f79dd2-4e84-362f-0ba8-9d9546a5c8ed@treenet.co.nz>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/36097
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>

On 24/11/18 11:11 am, Evert Pot wrote:
> 
> 
> On 11/23/18 1:12 AM, Mark Nottingham wrote:
>> Hi Evert,
>>
>> Just some personal thoughts. 
>>
>> Although folks are generally not as optimistic about Push as they used to be, I think there's still some appetite for considering it for non-browsing use cases; as such, this is potentially interesting.
>>
>> However, it's not clear at all how it'd work to me. Push is effectively hop-by-hop; intermediaries need to make a decision to send it, and that decision needs to be informed. How will a generic intermediary (like a CDN) know what link relations like "item" and "author" are, and how to apply them to a particular connection? 
>>
>> It's likely that a server (whether an intermediary or an origin) is going to have many, many potential representations of these types to send, so it'll need to have knowledge of the format to be able to get those links out and push the appropriate responses. That doesn't seem generic -- unless you require all of the potentially pushable links to appear in Link headers (which doesn't seem like it would scale very well).
> 
> I potentially see this used in 2 ways:
> 
> * Through link headers
> * By sending links in response bodies, such as HTML, HAL and ATOM.
> 
> The draft, as it's written it is agnostic about where the links appear.
> 
> The origin server will generally know which resources to send based on
> these links, and link-relationships appearing in Prefer-Push would only
> apply to links for which the context uri is the request uri.
> 
> In the case of Link headers, intermediaries could cache which links were
> available and push optimistically. I agree though if links are in the
> body, it's unlikely proxies will parse and push those. I think that's OK.
> 
> I'm not entirely sure about the potential scale concern. Is the concern
> mainly about the appearance of many Link headers? Intuitively this makes
> sense to me. However, for links appearing in response bodies; usually
> they are already exist there so we're not really sending any additional
> bytes.

Linked resources are not always fetched by Browsers. Either because they
are already in the client-side cache, or because they are not necessary
for the part(s) of the page are being displayed or otherwise used. That
is a large source of extra PUSH bytes that can be avoided.


> 
>>
>> Pushing *all* of the resources -- or even a significant subset -- is likely to cause performance problems of its own, as there will be contention with any other requests made for bandwidth. This is one of the big things we've learned about push in the browsing use case, and I suspect it applies here as well.
> 
> I think one of the use-cases we need to test is for example, a JSON
> collection that contains "n" items. Each is represented as a resource,
> and linked to the collection with an "item" link relationship.
> 
> In the past each resource may have been 'embedded' in the response body
> of the collection resource, but now we're pushing them. We'll need to
> benchmark to find out for what value of "n" this starts breaking.

I think it is important to distinguish what "the past" actually means.

If by past you mean HTTP/1.0 world. Yes that world benefited from
inlining content as described.

If by past you mean HTTP/1.1 world. That world did not gain nearly as
much benefit from inline objects. Often use of inline prevented
mechanisms like If-* revalidation, pipelining and compression from
achieving best bandwidth reductions.
 The delays waiting for objects earlier in a pipeline still gave a small
edge-case argument for inlining some resources. Contrary to popular myth
a lot of services do not actually benefit from inlining in a purely
HTTP/1.1 world.


HTTP/2 adds multiplexing at the frame level rather than message level so
there is not even those pipeline delay cases existing. Even if one
ignores PUSH completely inlining resources is a negative for performance
in the HTTP/2 world.

PUSH only adds way to further optimize some edge cases where the index
object delivery is less important that the objects it references. So the
sub-objects it references should start delivery immediately and prior to
the index itself.


> 
> Frankly, I have no idea even what order of magnitude "n" is in. My hope
> is that once we know, we can determine a few best practices for this
> feature. It's still possible that we'll find that it's just not possible
> to get reasonable performance out of this, but we intend to find out.
> 

AFAIK that 'n' is what the Browser people have been measuring and
testing about these past few years. At lest for their type of traffic.

IMHO that approach is a good one to follow for non-browser agents as
well for their type of traffic before this kind of specification gets
standardized as "The" way to do things. You may find that PUSH is
actually a bad way to go, 'n' is too small to be much use, or just
wildly different from your assumptions.


> Anyway, I'm still curious to learn a bit more about the performance
> problems about doing many pushes. Is there mainly an issue with having
> too many parallel H2 streams? Could it be solved by limiting the number
> of parallel pushes?
> 

I'm not sure of "mainly" is the right word. There are definitely
problems with doing a lot of H2 PUSH'es. From the same causes in general
packet networking that it is a bad idea for TCP to have too many packets
in-transit awaiting ACK.
It causes memory and resource pressure on every hop of the network that
traffic goes through. The more you do the more chance something
somewhere breaks one of them and causes the whole set (or a subset "up
to N") to enter a failure-recovery state.

It is a fine tight-rope style balancing act that both endpoints are
doing with only _guesses_ about what the other endpoint actually needs
to receive. The whole complex issue of message priorities in HTTP/2, for
force some messages to go faster or slower than others is in part to
counter incorrect guessing.



> If this has to do with the number of streams, I image the issue also
> exist with having an similar number of parallel GET requests. But maybe
> there's something specific to Push.
> 

One key difference with parallel GET is that the server can be
absolutely sure the client actually wants those objects. With PUSH the
server is guessing and every wrong guess is a waste of bandwidth.

Also, the client message rejecting/closing a PUSH stream is most delayed
when bandwidth limits are slowing traffic down overall, least when
bandwidth is plentiful and fast. So the impact/waste of PUSH is at its
worst during the very times it is most important to avoid wasting bandwidth.


Amos