Try
↑ ↓ move↵ openesc close
In this lesson · topic 4 of 7
  1. 1. The cost before the first byte
  2. 2. Handshakes and connection pools
  3. 3. Pool size, protocol and packet loss
  4. 4. A pool that is too small
  5. 5. HTTP/1.1 against HTTP/2
  6. 6. Head-of-line blocking and QUIC
  7. 7. Connections in review

Topic 4

A pool that is too small

4 min read

Sizing from the rate

A connection that serves one request at a time can finish a request every 90 ms in the lab. At 200 requests a second, about 18 requests are in service at any moment. That is the number of busy connections. Anything below it falls behind.

With HTTP/1.1 and a pool of 8, the queue held 728 requestsmeasured after 600 ticks, and the 99th percentile latency was 3610 msmeasured. With a pool of 32, nothing queued and the 99th percentile was 90 msmeasured, one round trip plus the work.

There is no gentle middle. When the arrival rate is above what the pool can serve, the queue grows for as long as the overload lasts. When it is below, the queue stays empty. A pool a little too small is much worse than a pool a little too large.

The other limit

A bigger pool is not free. Each connection holds memory on both ends, and a thousand clients with 32 connections each is 32,000 connections on the server. Keep the pool near what the rate needs, with some headroom for bursts, and count the total across all clients.

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