Internet-Draft HTTP Backpressure August 2024
Lasso Expires 10 February 2025 [Page]
Workgroup:
Internet Engineering Task Force
Internet-Draft:
draft-soni-http-dynamic-backpressure-00
Published:
Intended Status:
Standards Track
Expires:
Author:
S. Lasso

Dynamic Backpressure for HTTP-based systems

Abstract

This document describes a mechanism for introducing dynamic backpressure into an HTTP-based system, to aid in controlling server resources while minimizing tradeoffs.

Status of This Memo

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.

Table of Contents

1. Introduction

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.

1.1. Requirements Language

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.

2. Background: Why use dynamic backpressure

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!".

3. Solution: The Refresh HTTP header

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.


                      Control Loop

     req/s  +     +-------------------+   wait-seconds
         -->(+)-->| Control  function |----+------->
             ^-   +-------------------+    |
             |    +-------------------+    |
             +----| Feedback function |<---+
                  +-------------------+


Figure 1: Control loop

4. Rejected alternatives

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.

5. IANA Considerations

This document requests that the IANA update the registration for the Refresh header to also point to this document.

6. Security Considerations

This document should not affect the security of the Internet. After all, the Refresh header is already widely deployed.

7. References

7.1. Normative References

[RFC2119]
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <https://www.rfc-editor.org/info/rfc2119>.
[RFC8174]
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <https://www.rfc-editor.org/info/rfc8174>.
[RFC3986]
Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10.17487/RFC3986, , <https://www.rfc-editor.org/info/rfc3986>.
[RFC5234]
Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, DOI 10.17487/RFC5234, , <https://www.rfc-editor.org/info/rfc5234>.

7.2. Informative References

[WHATWG-HTML]
van Kesteren, A., "HTML Standard", , <https://html.spec.whatwg.org/multipage/>.

Acknowledgements

The authors would like to acknowledge the true power of the Refresh header. It had to be very powerful to survive this long.

Author's Address

Soni Lasso Terense