HTTP/1.1 vs HTTP/2

HTTP/1.1 sends one request at a time on a connection, so requests wait in line. HTTP/2 sends many requests at once on one connection. With a 90 ms round trip and 30 requests/s, one HTTP/1.1 connection falls behind and HTTP/2 keeps p99 under 140 ms.

Play the level

Connections and streamsDrag or use arrow keys to change the protocol

HTTP/1.1 · connections: 6 · 30 files in 7 round trips, 630 ms

A page waits for its slowest callDrag or use arrow keys to change the calls per page

Calls per page: 20 · 18% of pages wait 2.0 s

Case 1

A phone with a 90 ms round trip sends 30 requests/s to one API. p99 must stay under 140 ms.

Case 1
Measure Goal HTTP/1.1, one connection HTTP/2, reused connections
p99 latency under 140 ms 10.1 s Fail 92 ms Pass
Monthly cost 4 USD/mo 4 USD/mo
Error rate 57.8% 0%
HTTP/1.1Mobile usersAPI server1 vCPU · 1 GB
HTTP/1.1Mobile usersAPI server1 vCPU · 1 GB
HTTP/1.1, one connection: misses a goal
HTTP/2Mobile usersAPI server1 vCPU · 1 GB
HTTP/2Mobile usersAPI server1 vCPU · 1 GB
HTTP/2, reused connections: meets the goals