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.
HTTP/1.1 · connections: 6 · 30 files in 7 round trips, 630 ms
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.
| 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% |