将Google Chrome的每服务器最大连接数限制增加到6个以上

时间:2022-10-02 23:59:53

As far as I know, at the current moment, late 2011 the max-connections-per-server limit remains 6. Please correct me if I am wrong. This is bad that we cannot fix this easily as in Firefox. As far as I know this value is hardcoded.

据我所知,目前,2011年末,每服务器的最大连接数限制为6.如果我错了,请纠正我。这很糟糕,我们无法像在Firefox中那样轻松解决这个问题。据我所知,这个值是硬编码的。

One of the solutions is to download the Chromium's sources and rebuild them. Is there a more easy solution?

其中一个解决方案是下载Chromium的源并重建它们。有更简单的解决方案吗?

Is there any tricky way to hack this without creating a dozen of mirror-domains?

是否有任何棘手的方法可以在不创建十几个镜像域的情况下破解它?

Why I'm asking the question: My task is to create a html-javascript slideshow that will run inside a fullscreened browser, and a huge monitor is hanging on the wall. The javascript is really complicated, it preloads photos and makes a lot of ajax calls to my web services. If WIFI connection is slow, if 6 photos are loading, the AJAX calls fail, the application runs bad. I want a fast solution based, on http or browser or ubuntu tweak something else, because rebuilding the javascript app will take days.

为什么我要问这个问题:我的任务是创建一个html-javascript幻灯片,它将在一个全屏浏览器中运行,并且一个巨大的监视器挂在墙上。 javascript非常复杂,它会预先加载照片并对我的Web服务进行大量的ajax调用。如果WIFI连接速度很慢,如果加载了6张照片,则AJAX调用失败,应用程序运行不正常。我想要一个快速的解决方案,在http或浏览器或ubuntu调整其他东西,因为重建javascript应用程序将需要数天。

Offtopic: do you know any other things that can be tweaked in my concrete situation?

Offtopic:你知道在我的具体情况下可以调整的其他事情吗?

5 个解决方案

#1


24  

IE is even worse with 2 connection per domain limit. But I wouldn't rely on fixing client browsers. Even if you have control over them, browsers like chrome will auto update and a future release might behave differently than you expect. I'd focus on solving the problem within your system design.

每个域限制有2个连接,IE更糟糕。但我不会依赖修复客户端浏览器。即使您可以控制它们,Chrome之类的浏览器也会自动更新,未来版本的行为可能与您预期的不同。我专注于解决系统设计中的问题。

Your choices are to:

您的选择是:

  1. Load the images in sequence so that only 1 or 2 XHR calls are active at a time (use the success event from the previous image to check if there are more images to download and start the next request).

    按顺序加载图像,以便一次只激活1或2个XHR调用(使用上一个图像中的成功事件来检查是否有更多图像要下载并启动下一个请求)。

  2. Use sub-domains like serverA.myphotoserver.com and serverB.myphotoserver.com. Each sub domain will have its own pool for connection limits. This means you could have 2 requests going to 5 different sub-domains if you wanted to. The downfall is that the photos will be cached according to these sub-domains. BTW, these don't need to be "mirror" domains, you can just make additional DNS pointers to the exact same website/server. This means you don't have the headache of administrating many servers, just one server with many DNS records.

    使用serverA.myphotoserver.com和serverB.myphotoserver.com等子域。每个子域都有自己的连接限制池。这意味着如果您愿意,您可以将2个请求发送到5个不同的子域。缺点是照片将根据这些子域进行缓存。顺便说一句,这些不需要是“镜像”域,你可以只为相同的网站/服务器制作额外的DNS指针。这意味着您不必担心管理许多服务器,只需要一台具有许多DNS记录的服务器。

#2


3  

BTW, HTTP 1/1 specification (RFC2616) suggests no more than 2 connections per server.

BTW,HTTP 1/1规范(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.

使用持久连接的客户端应该限制它们维护到给定服务器的同时连接数。单用户客户端不应该与任何服务器或代理保持2个以上的连接。代理应该使用最多2 * N个连接到另一个服务器或代理,其中N是同时活动用户的数量。这些准则旨在改善HTTP响应时间并避免拥塞。

#3


2  

just adding this for the reference. I came across this article of how to increase the max downloads per domain in google chrome http://www.ehow.com/how_12169537_change-number-simultaneous-downloads-chrome.html

只需添加此参考。我看到了如何增加谷歌浏览器中每个域的最大下载量的这篇文章http://www.ehow.com/how_12169537_change-number-simultaneous-downloads-chrome.html

#4


0  

I don't know that you can do it in Chrome outside of Windows -- some Googling shows that Chrome (and therefore possibly Chromium) might respond well to a certain registry hack.

我不知道你可以在Windows之外的Chrome中做到这一点 - 一些谷歌搜索显示Chrome(因此可能是Chromium)可能对某个注册表黑客反应良好。

However, if you're just looking for a simple solution without modifying your code base, have you considered Firefox? In the about:config you can search for "network.http.max" and there are a few values in there that are definitely worth looking at.

但是,如果您只是在不修改代码库的情况下寻找简单的解决方案,那么您是否考虑过Firefox?在about:config中,您可以搜索“network.http.max”,其中有一些绝对值得关注的值。

Also, for a device that will not be moving (i.e. it is mounted in a fixed location) you should consider not using Wi-Fi (even a Home-Plug would be a step up as far as latency / stability / dropped connections go).

此外,对于不会移动的设备(即它安装在固定位置),您应该考虑不使用Wi-Fi(就延迟/稳定性/断开连接而言,即使是Home-Plug也会有所提升) 。

#5


-1  

There doesn't appear to be an external way to hack the behaviour of the executables.

似乎没有外部方法来破解可执行文件的行为。

You could modify the Chrome(ium) executables as this information is obviously compiled in. That approach brings a lot of problems with support and automatic upgrades so you probably want to avoid doing that. You also need to understand how to make the changes to the binaries which is not something most people can pick up in a few days.

您可以修改Chrome(ium)可执行文件,因为这些信息显然是编译进来的。这种方法带来了许多支持和自动升级的问题,因此您可能希望避免这样做。您还需要了解如何对二进制文件进行更改,而这些更改不是大多数人在几天内可以获取的。

If you compile your own browser you are creating a support issue for yourself as you are stuck with a specific revision. If you want to get new features and bug fixes you will have to recompile. All of this involves tracking Chrome development for bugs and build breakages - not something that a web developer should have to do.

如果您编译自己的浏览器,则会因为您遇到特定修订而自行创建支持问题。如果您想获得新功能和错误修复,则必须重新编译。所有这些都涉及跟踪Chrome开发中的错误和构建破坏 - 这不是Web开发人员应该做的事情。

I'd follow @BenSwayne's advice for now, but it might be worth thinking about doing some of the work outside of the client (the web browser) and putting it in a background process running on the same or different machines. This process can handle many more connections and you are just responsible for getting the data back from it. Since it is local(ish) you'll get results back quickly even with minimal connections.

我现在关注@BenSwayne的建议,但是可能值得考虑在客户端(Web浏览器)之外做一些工作,并将其放在运行在相同或不同机器上的后台进程中。此进程可以处理更多连接,您只负责从中获取数据。由于它是本地(ish),即使连接最少,您也可以快速获得结果。

#1


24  

IE is even worse with 2 connection per domain limit. But I wouldn't rely on fixing client browsers. Even if you have control over them, browsers like chrome will auto update and a future release might behave differently than you expect. I'd focus on solving the problem within your system design.

每个域限制有2个连接,IE更糟糕。但我不会依赖修复客户端浏览器。即使您可以控制它们,Chrome之类的浏览器也会自动更新,未来版本的行为可能与您预期的不同。我专注于解决系统设计中的问题。

Your choices are to:

您的选择是:

  1. Load the images in sequence so that only 1 or 2 XHR calls are active at a time (use the success event from the previous image to check if there are more images to download and start the next request).

    按顺序加载图像,以便一次只激活1或2个XHR调用(使用上一个图像中的成功事件来检查是否有更多图像要下载并启动下一个请求)。

  2. Use sub-domains like serverA.myphotoserver.com and serverB.myphotoserver.com. Each sub domain will have its own pool for connection limits. This means you could have 2 requests going to 5 different sub-domains if you wanted to. The downfall is that the photos will be cached according to these sub-domains. BTW, these don't need to be "mirror" domains, you can just make additional DNS pointers to the exact same website/server. This means you don't have the headache of administrating many servers, just one server with many DNS records.

    使用serverA.myphotoserver.com和serverB.myphotoserver.com等子域。每个子域都有自己的连接限制池。这意味着如果您愿意,您可以将2个请求发送到5个不同的子域。缺点是照片将根据这些子域进行缓存。顺便说一句,这些不需要是“镜像”域,你可以只为相同的网站/服务器制作额外的DNS指针。这意味着您不必担心管理许多服务器,只需要一台具有许多DNS记录的服务器。

#2


3  

BTW, HTTP 1/1 specification (RFC2616) suggests no more than 2 connections per server.

BTW,HTTP 1/1规范(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.

使用持久连接的客户端应该限制它们维护到给定服务器的同时连接数。单用户客户端不应该与任何服务器或代理保持2个以上的连接。代理应该使用最多2 * N个连接到另一个服务器或代理,其中N是同时活动用户的数量。这些准则旨在改善HTTP响应时间并避免拥塞。

#3


2  

just adding this for the reference. I came across this article of how to increase the max downloads per domain in google chrome http://www.ehow.com/how_12169537_change-number-simultaneous-downloads-chrome.html

只需添加此参考。我看到了如何增加谷歌浏览器中每个域的最大下载量的这篇文章http://www.ehow.com/how_12169537_change-number-simultaneous-downloads-chrome.html

#4


0  

I don't know that you can do it in Chrome outside of Windows -- some Googling shows that Chrome (and therefore possibly Chromium) might respond well to a certain registry hack.

我不知道你可以在Windows之外的Chrome中做到这一点 - 一些谷歌搜索显示Chrome(因此可能是Chromium)可能对某个注册表黑客反应良好。

However, if you're just looking for a simple solution without modifying your code base, have you considered Firefox? In the about:config you can search for "network.http.max" and there are a few values in there that are definitely worth looking at.

但是,如果您只是在不修改代码库的情况下寻找简单的解决方案,那么您是否考虑过Firefox?在about:config中,您可以搜索“network.http.max”,其中有一些绝对值得关注的值。

Also, for a device that will not be moving (i.e. it is mounted in a fixed location) you should consider not using Wi-Fi (even a Home-Plug would be a step up as far as latency / stability / dropped connections go).

此外,对于不会移动的设备(即它安装在固定位置),您应该考虑不使用Wi-Fi(就延迟/稳定性/断开连接而言,即使是Home-Plug也会有所提升) 。

#5


-1  

There doesn't appear to be an external way to hack the behaviour of the executables.

似乎没有外部方法来破解可执行文件的行为。

You could modify the Chrome(ium) executables as this information is obviously compiled in. That approach brings a lot of problems with support and automatic upgrades so you probably want to avoid doing that. You also need to understand how to make the changes to the binaries which is not something most people can pick up in a few days.

您可以修改Chrome(ium)可执行文件,因为这些信息显然是编译进来的。这种方法带来了许多支持和自动升级的问题,因此您可能希望避免这样做。您还需要了解如何对二进制文件进行更改,而这些更改不是大多数人在几天内可以获取的。

If you compile your own browser you are creating a support issue for yourself as you are stuck with a specific revision. If you want to get new features and bug fixes you will have to recompile. All of this involves tracking Chrome development for bugs and build breakages - not something that a web developer should have to do.

如果您编译自己的浏览器,则会因为您遇到特定修订而自行创建支持问题。如果您想获得新功能和错误修复,则必须重新编译。所有这些都涉及跟踪Chrome开发中的错误和构建破坏 - 这不是Web开发人员应该做的事情。

I'd follow @BenSwayne's advice for now, but it might be worth thinking about doing some of the work outside of the client (the web browser) and putting it in a background process running on the same or different machines. This process can handle many more connections and you are just responsible for getting the data back from it. Since it is local(ish) you'll get results back quickly even with minimal connections.

我现在关注@BenSwayne的建议,但是可能值得考虑在客户端(Web浏览器)之外做一些工作,并将其放在运行在相同或不同机器上的后台进程中。此进程可以处理更多连接,您只负责从中获取数据。由于它是本地(ish),即使连接最少,您也可以快速获得结果。