如何配置 Apache2 以允许来自同一 IP 地址的多个同时连接? [英] How do I configure Apache2 to allow multiple simultaneous connections from same IP address?
问题描述
默认情况下,Apache2 似乎只允许每个 IP 地址有 1 个连接.
By default, Apache2 seems to allow only 1 connection per IP address.
如何配置 Apache2 以允许来自同一 IP 地址的多个同时连接?
How do I configure Apache2 to allow multiple simultaneous connections from the same IP address?
这是我的情况:
- 托管在服务器上的网络应用.
- 远程客户端发出的请求可能需要 15 秒才能完成.
- 同一个远程客户端发出另一个(独立的)请求.
- 目前,第 2 个请求在队列中,直到第 1 个请求完成,因为 Apache2 似乎对每个 IP 地址施加了 1 个连接的限制.
如何覆盖此默认行为并允许并行处理第二个请求?
How do I override this default behaviour and allow the 2nd request to be processed in parallel?
提前致谢,大卫琼斯
推荐答案
我找到了问题的答案.原来其他人之前也遇到过这种困难:
I discovered the answer to my problem. It turns out others have encountered this difficulty before:
关键细节是 PHP 中基于文件的会话导致来自同一客户端的所有请求在队列中按顺序处理,而不是并行处理.
The key detail is that file-based sessions in PHP cause all requests from the same client to be processed sequentially in a queue, rather than in parallel.
为了解决这个问题,需要调用session_write_close
() 在会话处理完成后立即出现在每个 PHP 脚本中.
In order to solve this problem, it is necessary to make a call to session_write_close
() in every PHP script as soon as session handling is finished.
-- 大卫琼斯
这篇关于如何配置 Apache2 以允许来自同一 IP 地址的多个同时连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!