主流浏览器并发连接数

浏览器默认对同一域下的资源,只保持一定的连接数,会阻塞过多的连接。rfc2616建议不超过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. 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.

不同浏览器的默认值不一样,对于不同的HTTP协议其值也不一样。见下表。
 

浏览器默认最大并发连接数
浏览器HTTP 1.1HTTP 1.0
IE 6,724
IE 866
Firefox 228
Firefox 366
Safari 3, 444
Chrome 1,26?
Chrome 344
Opera 9.63,10.00alpha44

上表数据来自Steve Souders

总的来看,HTTP1.0下允许的连接数普遍大于HTTP1.1协议下的,是因为HTTP1.1是保持连接的,本身对同域下资源的获取就是优化的,且对资源的消耗要大于HTTP1.0。在rfc2616中说到,限制连接数的目的在于提高响应速度和避免拥塞

修改浏览器最大连接数

1. Firefox

在文件 X:\Program Files\Mozilla Firefox\greprefs\all.js中,有如下的参数:

//​ ​i​f​ ​n​e​t​w​o​r​k​.​h​t​t​p​.​k​e​e​p​-​a​l​i​v​e​ ​i​s​ ​t​r​u​e​,​ ​a​n​d​ ​i​f​ ​N​O​T​ ​c​o​n​n​e​c​t​i​n​g​ ​v​i​a​ ​a​ ​p​r​o​x​y​,​ ​t​h​e​n​
​/​/​ ​a​ ​n​e​w​ ​c​o​n​n​e​c​t​i​o​n​ ​w​i​l​l​ ​o​n​l​y​ ​b​e​ ​a​t​t​e​m​p​t​e​d​ ​i​f​ ​t​h​e​ ​n​u​m​b​e​r​ ​o​f​ ​a​c​t​i​v​e​ ​p​e​r​s​i​s​t​e​n​t​
/​/​ ​c​o​n​n​e​c​t​i​o​n​s​ ​t​o​ ​t​h​e​ ​s​e​r​v​e​r​ ​i​s​ ​l​e​s​s​ ​t​h​e​n​ ​m​a​x​-​p​e​r​s​i​s​t​e​n​t​-​c​o​n​n​e​c​t​i​o​n​s​-​p​e​r​-​s​e​r​v​e ​r​.​
​p​r​e​f​(​"​n​e​t​w​o​r​k​.​h​t​t​p​.​m​a​x​-​p​e​r​s​i​s​t​e​n​t​-​c​o​n​n​e​c​t​i​o​n​s​-​p​e​r​-​s​e​r​v​e​r​"​,​ ​6​)​;​

/​/​ ​i​f​ ​n​e​t​w​o​r​k​.​h​t​t​p​.​k​e​e​p​-​a​l​i​v​e​ ​i​s​ ​t​r​u​e​,​ ​a​n​d​ ​i​f​ ​c​o​n​n​e​c​t​i​n​g​ ​v​i​a​ ​a​ ​p​r​o​x​y​,​ ​t​h​e​n​ ​a​
/​/​ ​n​e​w​ ​c​o​n​n​e​c​t​i​o​n​ ​w​i​l​l​ ​o​n​l​y​ ​b​e​ ​a​t​t​e​m​p​t​e​d​ ​i​f​ ​t​h​e​ ​n​u​m​b​e​r​ ​o​f​ ​a​c​t​i​v​e​ ​p​e​r​s​i​s​t​e​n​t​
/​/​ ​c​o​n​n​e​c​t​i​o​n​s​ ​t​o​ ​t​h​e​ ​p​r​o​x​y​ ​i​s​ ​l​e​s​s​ ​t​h​e​n​ ​m​a​x​-​p​e​r​s​i​s​t​e​n​t​-​c​o​n​n​e​c​t​i​o​n​s​-​p​e​r​-​p​r​o​x​y ​.​
​p​r​e​f​(​"​n​e​t​w​o​r​k​.​h​t​t​p​.​m​a​x​-​p​e​r​s​i​s​t​e​n​t​-​c​o​n​n​e​c​t​i​o​n​s​-​p​e​r​-​p​r​o​x​y​"​,​ ​8​)​;


2. IE

需要修改注册表或组策略,详情见微软的技术支持

转载于:https://www.cnblogs.com/web-backend/archive/2010/05/03/1726835.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值