How to LIMIT concurrent (parallel) browser requests in Chrome? How to LIMIT concurrent (parallel) browser requests in Chrome? selenium selenium

How to LIMIT concurrent (parallel) browser requests in Chrome?


after some digging and searching i found out that for Chromium Many of network tune parameters are in ClientSocketPoolManager check lines : 29 and 46, So i think You will need to rebuild your own custom Chrome with your preferred parameter rather than be able to dynamically tune them.


Browser connection limitations

Browsers limit the number of HTTP connections with the same domain name. This restriction is defined in the HTTP specification (RFC2616). Most modern browsers allow six connections per domain. Most older browsers allow only two connections per domain.


The HTTP/1.1 RFC

The Section 8.1.4 of the HTTP/1.1 RFC mentions that:

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. A proxy SHOULD use up to 2*N connections to another server or proxy, where N is the number of simultaneously active users. These guidelines are intended to improve HTTP response times and avoid congestion.

Modern browsers are less restrictive than this allowing a larger number of connections. The RFC does not specify how to prevent the limit being exceeded. Either connections can be blocked from opening or existing connections can be closed.


Settings for Current Browsers

Steve Souders in his article Roundup on Parallel Connections provided the number of connections per server supported by current browsers for HTTP/1.1 as well as HTTP/1.0 which is as follows:

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

It is possible to reconfigure your browser tweaking the MaxConnectionsPerServer and MaxConnectionsPer1_0Server settings in the Windows Registry control the number of connections per hostname for HTTP/1.1 and HTTP/1.0 respectively.

In Firefox these values can be controlled by the network.http.max-connections and network.http.max-connections-per-server settings in about:config.

Now to Match Firefox's per-host connection limit of 15 Chromium/Chrome team tried to match the same and went through the discussion Configurable connections-per-host but ended up without any conclusions.


Conclusion

The same standards are also applicable while you use any of the WebDriver and Web Browser variant combo. The behavior with Selenium Grid Setup, Chrome Headless and Firefox Headless will also be identical.


References