Try
↑ ↓ move↵ openesc close

Interview prep / Connections and head-of-line blocking

Mid · Connections and head-of-line blocking · System design interview question

What is head-of-line blocking in TCP, and why does it hurt HTTP/2?

Sketch your own answer first, then compare it with the one below.

A strong answer

TCP hands the application one ordered stream of bytes. If a packet is lost, later packets may arrive, but TCP cannot deliver them until the lost one is retransmitted.

HTTP/2 puts many streams on that one byte stream. A lost packet carrying data for one stream holds back every other stream on the connection, even though their data arrived. The more streams share the connection, the more requests a single loss delays.

On a clean network it rarely matters. On a lossy one, such as mobile, it can make HTTP/2 slower in the tail than several HTTP/1.1 connections.

Sources

Learn it by running it

The connections and head-of-line blocking lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms