Internet-Draft | HTTP Backpressure | August 2024 |
Lasso | Expires 10 February 2025 | [Page] |
This document describes a mechanism for introducing dynamic backpressure into an HTTP-based system, to aid in controlling server resources while minimizing tradeoffs.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 10 February 2025.¶
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
Operating an HTTP service can get expensive. One of the ways services can manage the costs is by providing backpressure. Traditionally, HTTP backpressure is implemented variously by refusing connections after a limit, holding a connection open and slowly trickling data into it, among other techniques. This document describes a simple and widely-deployed mechanism for implementing backpressure by telling the client when to make new requests.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
Consider the scenario: a service that is billed by requests, and an Atom feed that gains new entries every 5 minutes. This service is composed of app servers and caching load balancers, with a cache policy of 5 minutes. Yet, the service doesn't want Atom clients to send a request every 5 minutes. This scenario is exactly where dynamic backpressure would shine: it doesn't try to slow down or throttle the connections (not that it would be able to, due to the caches) or anything like that, it simply tells the client "hey, I would appreciate it if you waited N seconds before sending another request, thanks!".¶
The Refresh header is composed of a non-negative integer number of seconds to wait until the next request, and an optional URI to move future requests to, according to the following syntax described in Augmented BNF [RFC5234], borrowing 'URI-reference' from [RFC3986]:¶
refresh-value = wait-seconds [ ";url=" future-URI ] wait-seconds = 1*DIGIT future-URI = URI-reference¶
The value of 'wait-seconds' SHOULD NOT be shorter than the value of any caching policy applied to the document. The client SHOULD wait at least 'wait-seconds' before making new requests.¶
This syntax is in alignment with Section 7.7 of [WHATWG-HTML].¶
Below is a diagram of how the Refresh header can be used in a generic control loop, with requests per second as input and wait-seconds as output.¶
The Refresh header is strongly disliked by basically everyone, but it may well be the only mechanism that provides the desired properties. One may argue the Retry-After header would be a better substitute, but the Retry-After header isn't really specified for successful content requests such as those used by Atom feeds, nor is it as widely deployed as the Refresh header.¶
This document requests that the IANA update the registration for the Refresh header to also point to this document.¶
This document should not affect the security of the Internet. After all, the Refresh header is already widely deployed.¶
The authors would like to acknowledge the true power of the Refresh header. It had to be very powerful to survive this long.¶