Max Parallel Http Connections in a Browser

Max parallel http requests in Chrome

If the connection limit is reached, further requests will wait until connections free up.

How to get around browser's 6 concurrent connections per domain limit?

I don't think webRTC is limited to 6 connections per domain, since it is often used for P2P mesh connections where that restriction would make no sense.

But I'd be surprised if you got better performance out of 20 datachannels than one HTTP2 connection since the webRTC datachannel is really not optimized for throughput.

You might also want to look at using Service Workers to work around the problem in a different way.

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

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.

Is there still a practical 6 connection limit when using Server Sent Events with HTTP2?

I have implemented HTTP/2 in Jetty.

As explained in this answer, with HTTP/2 the max number of concurrent requests that a browser can make to the server is largely increased - not infinite but increased from 6-8 to about 100.

So yes, multiplexing solves this issue in practice (unless you open more than 100 or so tabs).

Note that this value is configured by servers, so it's possible that a server sends to the client a configuration with max number of concurrent requests set to a small number, but in practice servers have settled on a number around 100.

Having said that, you want to also read this other answer for a discussion about SSE vs WebSocket.

Increase Concurrent HTTP calls

14 requests is not an issue. It becomes issue only if server response time is large. So most likely the root issue is the server side performance

These solutions are possible:

  • use HTTP cache (server should send corresponding headers)
  • use cache at the middle (e.g. CDN, Varnish)
  • optimize server side
    • content related:
      • combine several requests into one
      • remove duplicated information in requests
      • do not load information which client doesn't render
    • use cache at server side
    • etc... any other approach... there are plenty of them.

UPDATE:

Suggestions for people who have to download static resources and have troubles with that...

  1. Check size of resources and optimize where possible

  2. Use HTTP2 - it shares connection between requests, so server will be less loaded and respond faster, mostly because it doesn't need to establish separate SSL connection per each request (web is secure nova days, everybody use HTTPS)

  3. HTTP specification limits number of parallel requests to single domain. This leaves chance to increase count of parallel requests using several different domains (or subdomains) to download required resources



Related Topics



Leave a reply



Submit