Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

According to the HTTP Specification (w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1.4), HTTP clients should limit their connections:

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.

Different vendors implement this limit differently: http://www.stevesouders.com/blog/2008/03/20/roundup-on-parallel-connections/

But. does this limitation applies per tab, per browser instance or globally for all the instances of the browser? Are pop-ups (dialogs) considered part of a tab or independent tabs?

Same for websockets, does the limit on connections per origin applies per tab, browser instance or globally?

like image 629
vtortola Avatar asked Apr 04 '14 15:04

vtortola


People also ask

How many simultaneous requests can a browser make?

Chrome has a limit of 6 connections per host name, and a max of 10 connections. This essentially means that it can handle 6 requests at a time coming from the same host, and will handle 4 more coming from another host at the same time.

Can you configure your browser to open multiple simultaneous connections to a website?

Yes, you can configure many browsers to open multiple simultaneous connections to a Web site. The advantage is that you will you potentially download the file faster.

How many concurrent requests can chrome handle?

By default each Cloud Run container instance can receive up to 80 requests at the same time; you can increase this to a maximum of 1000. Although you should use the default value, if needed you can lower the maximum concurrency. For example, if your code cannot process parallel requests, set concurrency to 1 .

How many parallel TCP connections does HTTP 2 use for a single domain?

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.


1 Answers

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.

like image 126
Matej Snoha Avatar answered Nov 10 '22 04:11

Matej Snoha