Is the per-host connection limit raised with HTTP/2?

16,350

Browsers impose a per-domain limit of 6-8 connections when using HTTP/1.1, depending on the browser implementation. This allows at most 6-8 concurrent requests per domain.

With HTTP/2, browsers open only 1 connection per domain. However, thanks to the multiplexing feature of the HTTP/2 protocol, the number of concurrent requests per domain is not limited to 6-8, but it is virtually unlimited.

It is virtually unlimited in the sense that browsers and servers may limit the number of concurrent requests via the HTTP/2 configuration parameter called SETTINGS_MAX_CONCURRENT_STREAMS.

Typical limits are around 100 (Firefox's default value for network.http.spdy.default-concurrent - note the spdy name here: it was the protocol ancestor of the HTTP/2 protocol) but could be larger (or, less commonly, smaller), depending on browser implementation and on the server you connect to.

Expect these limits to vary over the years with the evolution and the more widespread usage of HTTP/2 (in the same way it happened with HTTP/1.1: browsers started with 2 connections, and ended up to 6-8 after years of usage, experience and tuning).

I don't think there is any difference between how a browser treats the number of connections and concurrent requests for normal browsing and for the usage of XHR, so the explanations above holds true for XHR as well.

Share:
16,350
Shrinikesh A
Author by

Shrinikesh A

Unicorn lover.

Updated on June 07, 2022

Comments

  • Shrinikesh A
    Shrinikesh A about 2 years

    Browsers have a per-host limit regarding number of parallel XHR (about 6 nowadays).

    Does this restriction apply to multiplexed HTTP/2 connections?

  • gapple
    gapple over 7 years
    The client and server are each able to specify SETTINGS_MAX_CONCURRENT_STREAMS. If the client specifies a value to the server, that indicates the limit on how many resources the server is able to push. If the server specifies the value to the client, that indicates how many items the client is able to request. I'm uncertain if Firefox only uses network.http.spdy.default-concurrent to specify the limit to the server, or also limits its requests to that same value.
  • Pork 'n' Bunny
    Pork 'n' Bunny about 3 years
    How can I observe what SETTINGS_MAX_CONCURRENT_STREAMS is for a given server?
  • sbordet
    sbordet about 3 years
    The setting is not negotiated. The server tells the client how many concurrent streams it supports, and the client tells the server how many concurrent pushed streams it supports. To know the value, just look at the configuration on either side.