简体   繁体   English

如何配置Apache2以允许来自同一IP地址的多个同时连接?

[英]How do I configure Apache2 to allow multiple simultaneous connections from same IP address?

By default, Apache2 seems to allow only 1 connection per IP address. 默认情况下,Apache2似乎每个IP地址只允许1个连接。

How do I configure Apache2 to allow multiple simultaneous connections from the same IP address? 如何配置Apache2以允许来自同一IP地址的多个同时连接?

Here is my situation: 这是我的情况:

  1. a web app being hosted on a server. 托管在服务器上的Web应用程序。
  2. a remote client makes an request that may take 15 seconds to complete. 远程客户端发出可能需要15秒才能完成的请求。
  3. the same remote client makes another (independent) request. 同一个远程客户端发出另一个(独立)请求。
  4. at present, the 2nd request sits in a queue until the 1st request completes, since Apache2 seems to impose a limit of 1 connection per IP address. 目前,第二个请求位于队列中,直到第一个请求完成,因为Apache2似乎强加了每个IP地址1个连接的限制。

How do I override this default behaviour and allow the 2nd request to be processed in parallel? 如何覆盖此默认行为并允许并行处理第二个请求?

thanks in advance, David Jones 提前谢谢大卫琼斯

I discovered the answer to my problem. 我发现了问题的答案。 It turns out others have encountered this difficulty before: 事实证明其他人在遇到这种困难之前:

Simultaneous Requests to PHP Script 同时请求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. 关键细节是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. 为了解决这个问题,一旦会话处理完成,就必须在每个PHP脚本中调用session_write_close ()。

-- David Jones - 大卫琼斯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM