What's The Maximum Number of Simultaneous Connections a Browser Will Make

What's the maximum number of simultaneous connections a browser will make?

The short answer is "about 4 to 6 connections per domain"

For more details, check out this great roundup of how many parallel connections each browser will make to a given domain

Results summarized below...


+----------------------+------------+------------+
|Browser | HTTP/1.1 | HTTP/1.0 |
+----------------------+------------+------------+
|IE 6,7 | 2 ## | 4 #### |
|IE 8 | 6 ###### | 6 ###### |
|Firefox 2 | 2 ## | 8 ######## |
|Firefox 3 | 6 ###### | 6 ###### |
|Safari 3,4 | 4 #### | 4 #### |
|Chrome 1,2 | 6 ###### | ? |
|Chrome 3 | 4 #### | 4 #### |
|Chrome 4+ | 6 ###### | ? |
|iPhone 2 | 4 #### | ? |
|iPhone 3 | 6 ###### | ? |
|iPhone 4 | 4 #### | ? |
|Opera 9.63,10.00alpha | 4 #### | 4 #### |
|Opera 10.51+ | 8 ######## | ? |
+----------------------+------------+------------+

What does it really means by maximum concurrent connections in browser?

This limitation is a restriction put in place by each browser vendor. The typical connection limit for a browser instance is set to 6 socket connections to the same domain. These six connections make up the browsers socket pool. This socket pool is managed by the socket pool manager and are used across all browser processes. This is to maximize the efficiency of the TCP connection by reusing established connections, as well as other performance benefits.

According to the HTTP 1.1 specification the maximum number of connections should be limited to 2.

Clients that use persistent connections SHOULD limit the number of
simultaneous connections that they maintain to a given server. A
single-user client SHOULD NOT maintain more than 2 connections with
any server or proxy. These guidelines are intended to improve HTTP
response times and avoid congestion.

However, this spec was approved in June 1999 during the infancy of the internet, and browser vendors like Chrome have since increased this number to six.

Currently these are set to 32 sockets per proxy, 6 sockets per
destination host, and 256 sockets per process (not implemented exactly
correct, but good enough).

With that said, each socket pool is managed by each browser. Depending on the browsers connection limit (a minimum of two). You should be able to open 8 connections by opening two tabs in IE, Chrome, Firefox, and Safari. Your max connection is limited by the browser itself. Also keep in mind the server can only handle so many concurrent connections at once. Don't accidentally DoS yourself :)

If you absolutely need to go beyond the connection limitation you could look into domain sharding. Which basically tricks the browser into opening new more connections by providing a different the host name with the request. I wouldn't advise using it though, as the browser has set these limitations to maximize performance and reuse existing connections. Tread lightly.

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 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.

Max parallel http requests in Chrome

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

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.

HTTP simultaneous connections per host limit... are per tab, browser instance or global?

Browsers

The implementation details are bound to be different for different browsers, browser versions or internet connection speeds (IE8 uses 2 connections on dial-up and up to 6 otherwise).

Also, these limits are usually user-configurable (i.e. network.http.max-connections-per-server in Mozilla) and one shouldn't assume specific values based on the browser version. The actual value might be accessible to a script though, such as window.maxConnectionsPerServer in IE.

But. does this limitation applies per tab, per browser instance or globally for all the instances of the browser?

The only relevant piece of information I found was this regarding IE (http://social.msdn.microsoft.com/Forums/ie/en-US/a46bb0ba-419d-43ec-ad1b-f9596d508ca3/simultaneous-http-connection-limit):

The connection limit is per process, the browser will make the determination about process creation as a web site owner you can't really change that. The process may be shared between multiple tabs/windows or it may not, it depends on many factors outside your control

More current data about browsers can be found at www.browserscope.org/?category=network

RFC

There is an updated draft which obsoletes RFC2616 (if approved).
Citing the relevant part (from https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-p1-messaging-21#section-6.2.3):

6.2.3. Concurrency

Clients SHOULD limit the number of simultaneous connections that they
maintain to a given server.

Previous revisions of HTTP gave a specific number of connections as a
ceiling, but this was found to be impractical for many applications.
As a result, this specification does not mandate a particular maximum
number of connections, but instead encourages clients to be
conservative when opening multiple connections.

Multiple connections are typically used to avoid the "head-of-line
blocking" problem, wherein a request that takes significant server-
side processing and/or has a large payload blocks subsequent requests
on the same connection. However, each connection consumes server
resources. Furthermore, using multiple connections can cause
undesirable side effects in congested networks.

Note that servers might reject traffic that they deem abusive,
including an excessive number of connections from a client.



Related Topics



Leave a reply



Submit