gpt4 book ai didi

每个主机限制的 HTTP 同时连接数...是每个选项卡、浏览器实例还是全局?

转载 作者:可可西里 更新时间:2023-11-01 15:16:32 27 4
gpt4 key购买 nike

根据 HTTP 规范 (w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1.4),HTTP 客户端应限制其连接:

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.

不同的供应商以不同的方式实现此限制:http://www.stevesouders.com/blog/2008/03/20/roundup-on-parallel-connections/

但是。此限制适用于每个选项卡、每个浏览器实例还是全局适用于所有浏览器实例?弹出窗口(对话框)是选项卡的一部分还是独立选项卡?

同样适用于 websockets,每个来源的连接限制适用于每个选项卡、浏览器实例还是全局?

最佳答案

浏览器

对于不同的浏览器、浏览器版本或互联网连接速度,实现细节必然会有所不同(IE8 在拨号时使用 2 个连接,否则最多使用 6 个连接)。

此外,这些限制通常是用户可配置的(即 Mozilla 中的 network.http.max-connections-per-server),不应根据浏览器版本假定特定值。不过,脚本可能可以访问实际值,例如 IE 中的 window.maxConnectionsPerServer。

But. does this limitation applies per tab, per browser instance or globally for all the instances of the browser?

我找到的唯一相关信息是关于 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

有关浏览器的更多当前数据可以在 www.browserscope.org/?category=network 找到

RFC

有一个更新的草案废弃了 RFC2616(如果获得批准)。引用相关部分(来自 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 theymaintain to a given server.

Previous revisions of HTTP gave a specific number of connections as aceiling, but this was found to be impractical for many applications.As a result, this specification does not mandate a particular maximumnumber of connections, but instead encourages clients to beconservative when opening multiple connections.

Multiple connections are typically used to avoid the "head-of-lineblocking" problem, wherein a request that takes significant server-side processing and/or has a large payload blocks subsequent requestson the same connection. However, each connection consumes serverresources. Furthermore, using multiple connections can causeundesirable side effects in congested networks.

Note that servers might reject traffic that they deem abusive,including an excessive number of connections from a client.

关于每个主机限制的 HTTP 同时连接数...是每个选项卡、浏览器实例还是全局?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22866552/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com