Re: http/2 prioritization/fairness bug with proxies

Mark Nottingham <mnot@mnot.net> Mon, 04 February 2013 10:04 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 B2F0121F85DC for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 4 Feb 2013 02:04:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.944
X-Spam-Level:
X-Spam-Status: No, score=-9.944 tagged_above=-999 required=5 tests=[AWL=0.655, BAYES_00=-2.599, 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 VsIv1YOAqJrm for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 4 Feb 2013 02:04:15 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id B65BC21F8415 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 4 Feb 2013 02:04:15 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1U2IsL-00012j-Ut for ietf-http-wg-dist@listhub.w3.org; Mon, 04 Feb 2013 10:02:09 +0000
Resent-Date: Mon, 04 Feb 2013 10:02:09 +0000
Resent-Message-Id: <E1U2IsL-00012j-Ut@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <mnot@mnot.net>) id 1U2IsB-00010s-OG for ietf-http-wg@listhub.w3.org; Mon, 04 Feb 2013 10:01:59 +0000
Received: from mxout-07.mxes.net ([216.86.168.182]) by lisa.w3.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <mnot@mnot.net>) id 1U2IsA-0003lu-Nf for ietf-http-wg@w3.org; Mon, 04 Feb 2013 10:01:59 +0000
Received: from [192.168.1.80] (unknown [118.209.43.59]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id A682D22E1F3; Mon, 4 Feb 2013 05:01:33 -0500 (EST)
Content-Type: text/plain; charset="iso-8859-1"
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <510F72CE.8030003@treenet.co.nz>
Date: Mon, 04 Feb 2013 21:01:50 +1100
Cc: ietf-http-wg@w3.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <CDFC6823-BC3E-4F53-A9FA-9F0E7AAF0C12@mnot.net>
References: <CAA4WUYjiBZpShKKFfHQnixc94aOLrck0oR4ykARB=hF5h8nkfA@mail.gmail.com> <3430.1359961022@critter.freebsd.dk> <510F72CE.8030003@treenet.co.nz>
To: Amos Jeffries <squid3@treenet.co.nz>
X-Mailer: Apple Mail (2.1499)
Received-SPF: pass client-ip=216.86.168.182; envelope-from=mnot@mnot.net; helo=mxout-07.mxes.net
X-W3C-Hub-Spam-Status: No, score=-3.3
X-W3C-Hub-Spam-Report: AWL=-3.295, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001
X-W3C-Scan-Sig: lisa.w3.org 1U2IsA-0003lu-Nf 7174f4a228b6d2b6f31012bc4ea70907
X-Original-To: ietf-http-wg@w3.org
Subject: Re: http/2 prioritization/fairness bug with proxies
Archived-At: <http://www.w3.org/mid/CDFC6823-BC3E-4F53-A9FA-9F0E7AAF0C12@mnot.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/16351
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 04/02/2013, at 7:35 PM, Amos Jeffries <squid3@treenet.co.nz> wrote:

> On 4/02/2013 7:57 p.m., Poul-Henning Kamp wrote:
>> Content-Type: text/plain; charset=ISO-8859-1
>> --------
>> In message <CAA4WUYjiBZpShKKFfHQnixc94aOLrck0oR4ykARB=hF5h8nkfA@mail.gmail.com>
>> , =?UTF-8?B?V2lsbGlhbSBDaGFuICjpmYjmmbrmmIwp?= writes:
>> 
>>> Anyway, the existing prioritization bug is as follows:
>> [...]
>> 
>>> The backend server
>>> obviously can't do this because it doesn't (at least, shouldn't!) know
>>> the clients behind the proxy.
>> This flies counter to vast experience:  Servers do almost everything
>> they can to identify the actual client (X-F-F, cookies, fingerprinting
>> etc), so I think this premise needs to be rethought.
>> 
>>> I consider all those options as suboptimal, and thus consider this
>>> issue to be a protocol bug. Our SPDY/4 prioritization proposal
>>> addresses this by using stream groups with advisory (all this is
>>> advisory after all) [...]
>> So what does the groups buy you, for all the complexity they add ?
>> 
>> As far as I can tell:  Nothing.
>> 
>> I think the priority should simply be documented as advisory and
>> mention that intermediaries SHOULD respect them, subject to
>> local administrative policy, and leave it at that.
>> 
>> The current proposal is complex enough as it is, adding complexity
>> to not solve problems that cannot be solved technically, is not
>> an improvement.
> 
> +1. There are a lot of queuing, scheduling, and load balancing algorithms out there for the proxy to choose from and likely to be more or better ones found going forward.
> The proxy is already in a position to group (or not), or to simply delay I/O as necessary to make things fair for all clients according to their priority hints. A SHOULD is enough.

So, let's say I'm a proxy, and I currently have two clients, A and B.

Client A sends a stream of requests with the following priorities:

1 1 1 3 3 3 2 2 

and client B sends:

3 3 2 2 4 4

Let's say (for now) that they all go on the same forward connection.

With the current mechanism, you have to rewrite the priorities to balance their connections. So, you might change B's request stream priorities to:

2 2 1 1 3 3

But what should I do when, a few milliseconds later, B emits a request with priority "1"? I don't have a "0" priority. 

I suppose I could de-prioritise client A's requests, but that would just move the problem to the other end of the scale (least priority).

I imagine that a clever implementer would find a way to re-balance the priority space so that these effects were mitigated. However, not all implementers are clever, and even the clever implementers will do it in different ways, leading to variations in behaviour.

To me, grouping seems like a very easy way around this; you can maintain the relative priority of requests from a single context without rewriting them, and level out the weightings of groups if you're a proxy. 

BTW, I think there's a similar motivation in the original use case that motivated Will; he needs to be able to balance the priorities among a set of browser tabs, when it's possible for new requests to be generated by those tabs at any time.

Cheers,


--
Mark Nottingham   http://www.mnot.net/