-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Priorities should affect request behavior as well as response behavior #46
Comments
👍 |
1 similar comment
+1 |
The title "The Priority HTTP header field" makes these discussions hard because I'm not sure sure if @ianswett is talking about abstract absolute priority levels or concrete signal in the form of HTTP headers or frames. I think we should try to tackle terms in the next document update. I don't understand how a priority header can affect the scheduling of requests inside the user agent. However, the abstract concept herein is that the UA generates the priority signal based on its local usage of the resource. So it is fully in the means of UAs to modulate their behaviour (ordering, or send rate) based on usage. Is that what is being proposed on this ticket? The actual recommended behaviour is likely to depend on the connection prioritization scheme. For example, signalling lower priorities later might work well for FIFO but would perform poorly for LIFO. How specific is the guidance that we are attempting to capture? |
In my view, this is mostly for when developers are setting the priority themselves (e.g., indirectly using an HTML tag attribute or directly via fetch()). As we mentioned in the previous meeting, if "headers are the API" (much like how the preload header triggers push), then priority headers set by the developer on the client side (e.g., via JS) can/should trigger browser behavior changes. As Ian indicates, a developer performing a large background POST (e.g., from a service worker) could indicate this using priority headers, triggering appropriate browser-side behavior. I would see this as an option to impact HTTP/1.1 as well, where some requests can be delayed (not taking up 1 of the 6 allowed connections) if they are low priority. Granted, the benefits are not huge in my opinion, but enough to specifically adopt this use case (it's also nice and symmetrical ;)) |
As mentioned elsewhere, I'd like us to document use cases and actors so we can be clear in our communications. I'm not disputing some of the benefits but there are different system boundaries and relationships inside the UA - which the HTTP header document was not not geared up to handle and the IETF WG are perhaps not best placed to argue for or against. For instance, we are debating adding more dimensions and more levels of granularity, while the Priority Hints proposal has settled on 2 levels. Preload is a fantastic example of a header that means different things to different actors in the chain of a response - as such the community hits issues like this, where something safe in a server could be unsafe in a UA if used a certain way. It requires analysis and deep thought, adding friction. If we want to make a more extensible framework for prioritization, we should be mindful to such considerations. |
|
The simplest case where things get confusing are, taking Ian's example, making a POST Fetch request with a `Priority :urgency=background" header. If that is intended to control the UA's behaviour and/or the behaviour of the remote endpoint (proxy or server) sending the response. Should a UA consume such a header and repopulate it before transmission?
This is about the API surface exposed to web developers that allows them to control the user agent behaviour. The more options and parameters that we add, the harder it becomes for any developer to understand what the effect is. And since we are talking about using a header to control the behaviour of a user agent, I would presume the expectation is that it is exhaustively documented in a body such as W3C or WHATWG. Note that there is major overlap with the problem space of Priority Hints - its just that the solution is different. I'd also be concerned with web devs attempting to optimise priority when they don't have a good picture of the connection attributes of site in question.
The Fetch spec defines multiple levels of headers:
Forbidden header names are a category "so the user agent remains in full control over them.". Are we qualified to determine which of these lists Priority would belong to? Perhaps we would be better defining a mixin (or extension to the Body mixin) that can express the priority of a request & body. |
I was thinking of use cases like POST via fetch when I wrote this up, but I also had in mind cases when a browser or app sends a background priority request and it may want to delay that when there are a large number of other outstanding requests. I agree that clarifying terminology would be useful and I wonder if creating separate sections for some of these concepts in the draft would help? One way of splitting them would be:
|
See 3-year old open issue on Fetch
|
Also related issue in HTML whatwg/html#3670 |
I wanted to revisit this issue and suddenly realize that we might have crossed the river by merging #54. The abstract now talks about prioritizing "the delivery of HTTP responses," rather than the transmission. It is now possible to argue that prioritizing the delivery includes the order in which the requests are processed. I hope @LPardue would be OK with that. I also think that "delivery of response" might be a better way of phrasing the scope rather than discussing "prioritization of request and responses," as processing order of requests is something that's internal to the server. That's not something that a network protocol needs to talk about. @LPardue Does my comment here ease the concerns you have? If that is the case, I can create a PR that changes the tone of the document to talk more about delivery rather than transmission. I could also try to suggest (maybe a little bit) that the server can control the processing order of the requests to improve the delivery order. |
#54 didn't really change that part of the abstract, so I think it was a good change. I'd suggest removing "the delivery of" because it's a bit overly restrictive and I don't think it is helpful to the doc. In my mind, prioritization is very much about intent, so a server can use that information to do whatever it can to try to honor the intent, which could involve re-ordering the processing, sending to backends, delivery, etc. |
@ianswett Actually, we used to talk about specifying "the absolute precedence of an HTTP response," but PR 54 changed that to "prioritizing the delivery of HTTP responses."
Makes perfect sense. I now agree with you that it is best to talk about "prioritizing HTTP responses" rather than "prioritizing XXX of HTTP responses," regardless of what XXX is. At the moment, we do have sentences like "A server SHOULD transmit HTTP responses in the order of ..." I'll try to change those to not talk about transmission, etc. |
Agree with removing XXX. However, preserving use of transmission aligns us with H2's priority scheme which discussed it in those terms, from RFC 7540
And now that its been highlighted, I really don't like the term delivery. From an application perspective there is very little I can do to affect the way things are delivered. And very little the receiver of the delivery can do to validate I acted as it requested. But to get back on topic, I think the present design of |
Removed "delivery," as we seem to agree that it's bad. |
Let's assume that the transaction of a HTTP request-response can be divided into three elements: transmission of a request, processing of a request, transmission of a response. The scope of the draft definitely includes how the response is being transmitted. I am fine with keeping the transmission of requests out-of-scope, as I can see the concern regarding the schedule. OTOH, I do have a preference on including the processing of a request within the scope of the draft. The reason I want to suggest in the draft that the prioritization scheme can affect the processing order of the requests within the server is because it has benefits. In certain cases, a server does not have the enough internal concurrency to process all the request it receives from the client. For example, maximum number of FastCGI server processes that can be run in parallel is typically much smaller than the maximum number of concurrent requests that a HTTP/2 server can accept. When the H2 server hits the maximum concurrency of the FastCGI server processes, it needs to queue the requests and issue them in certain order. For that purpose, the value of the priority header is really handy. I'd argue that suggesting using the values of the priority header for this particular purpose is completely fine, as it is something internal to a server. It's not something a protocol specification needs to interfere. @LPardue Would you be fine with me talking about that in the I-D? |
I'm coming to the conclusion that the ticket is conflating different aspects. My objections are:
I could imagine that it would be helpful to have split-mode priorities that allow a client to express upload and download independently. For example, informing a server that data sample uploads to a server are very important, but the responses are much less important. |
For most practical use cases I can think of, I'm not sure the extra richness of a separate upload and download priority is worthwhile. In your example, the upload is important, but the response is probably tiny, so why not send it quickly? I think about each HTTP request as a transaction. Priorities are a way of saying "I'd like this transaction to complete before that one, assuming they're competing for resources at some level." In that sense, I think any layer using the information is within scope. On the other hand, I don't think we should add a MUST that every possible layer use the information, because that seems overly proscriptive and possibly impractical. |
Currently, there's no discussion of whether the priority header affects request behavior as well as response behavior. I believe it should affect both whenever possible and that should be specified.
In some cases, that could be a browser delaying sending lower priority requests behind higher priority ones, and in others(ie: a large POST) that could be changing the congestion control characteristics to ensure the request would not significantly impact other requests.
The text was updated successfully, but these errors were encountered: