主流浏览器的HTTP最大并发连接数

这几天翻阅了一下《HTTP: The Definitive Guide》这本书,还是学到一些东西。看到HTTP客户端一般对同一个服务器的并发连接个数都是有限制的,所以顺便再次总结一下浏览器对同一个服务器的HTTP最大并发连接数。

浏览器的并发连接数并非越大越好。书中的原话提到:In practice, browsers do use parallel connections, but they limit the total number of parallel connections to a small number (often four). Servers are free to close excessive connections from a particular client.

 

在IE浏览器中,可以如下方式修改IE浏览器的最大并发连接数

1. 在组策略中设置:

a. Click Start, click Run, type "gpedit.msc", and then click OK.

b. Expand User Configuration, expand Administrative Templates, expand Windows Components, expand Internet Explorer, expand Security Features, and then expand AJAX.

c. Set the Maximum number of connections per server (HTTP 1.0) and Maximum number of connections per server (HTTP 1.1) options to the settings that you want. You must update policies or restart the computer to apply these changes.

2. 直接修改注册表信息:

用“regedit”命令打开注册表编辑器,找到:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_MAXCONNECTIONSPERSERVER 和 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_MAXCONNECTIONSPER1_0SERVER

这两个键(分别是针对HTTP 1.1 和 HTTP 1.0的设置),然后设置值的名称为“iexplore.exe”的数值。

 

在Firefox中,可以用如下方式修改似乎Firefox浏览器的最大并发连接数

在Firefox的地址栏输入“about:config”,然后搜索并修改如下两个配置项目即可:

network.http.max-persistent-connections-per-server 和 network.http.max-persistent-connections-per-proxy

目前Chrome的最大并发连接数还不是很容易配置,一般来说是在编译时就一定指定好了的,没有提供Firefox中“about:config”这样类似的接口来方便修改。(这个我还没研究太多,有知道的朋友,欢迎给我留言)

 

一些主流浏览器对 HTTP 1.1 和 HTTP 1.0 的最大并发连接数目,可以参考如下表格:

 

 

Browser

HTTP/1.1

HTTP/1.0

IE 8,9

6

6

IE 6,7

2

4

Firefox 17

6

6

Firefox 3

6

6

Firefox 2

2

8

 

 

 

Safari 3,4

4

4

Chrome 1,2

6

?

Chrome 3

4

4

Chrome 4+

6

?

Opera 9.63,10.00alpha

4

4

Opera 10.51+

8

?

 

 

 

iPhone 2

4

?

iPhone 3

6

?

iPhone 4

4

?

iPhone 5

6

?

 

 

 

Android2-4

4

?

 

HTTP Pipelining(管线化):

iOS系统中的浏览器,从iOS5开始默认打开Pipelining

Android浏览器一直都是打开的,默认最大同时发送3个请求

 

*对于以上请求和连接数,Android系统在不同机型上会由厂商调整

 

更多信息 ,可以阅读如下文章:

http://support.microsoft.com/kb/282402

http://www.stevesouders.com/blog/2008/03/20/roundup-on-parallel-connections/

http://waynepan.com/2010/07/09/iphone-ios-4-froyo-browsers-and-concurrent-connections/

http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1.4

 

master

Stay hungry, stay foolish.

发表评论

邮箱地址不会被公开。 必填项已用*标注

*