In this lesson · topic 5 of 7
Topic 5
HTTP/1.1 against HTTP/2
4 min read
One request at a time
On an HTTP/1.1 connection, a response must finish before the next request can use it. A client that wants more parallelism opens more connections. Browsers cap the number per host for this reason, and pools do the same.
Many streams on one connection
HTTP/2, defined in RFC 9113, splits a connection into streams. Each request and its response travel on their own stream, and frames from different streams are interleaved. Many requests are in flight on one connection at once.
In the lab, a pool of four HTTP/2 connections carried the same 200 requests a second with no queue. The 99th percentile was 90 msmeasured, one round trip plus the work. The HTTP/1.1 pool of 8 gave 3610 msmeasured. HTTP/2 needed half as many connections, and the connection count no longer decided whether requests waited.
What it gives up
Fewer connections means fewer handshakes and less memory. It also means that each connection now carries many requests, and anything that harms the connection harms all of them at once. The next topics show what a lost packet does.