为什么apache不能同时处理来自同一个浏览器的多个请求 [英] Why does apache not process multiple requests from the same browser simultaneously

查看:33
本文介绍了为什么apache不能同时处理来自同一个浏览器的多个请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太确定如何正确表达这个问题,所以我将从我遇到的场景开始.

I'm not quite sure how to phrase this question correctly, so I'll start with the scenario I encountered.

我的 Web 应用程序中有一些处理时间比我希望用户等待再次控制页面的时间长,因此我决定通过 ajax 请求处理它.

I have a bit of processing in my web app that takes longer than I'd like the user to wait to have control of the page again, so I decided to have it processed by an ajax request.

问题是,即使我将此请求卸载到 ajax 请求中,在原始处理器繁重的请求完成之前,apache 似乎不会处理任何进一步的请求.

The problem is, even though I offloaded this request into an ajax request, it seems that apache won't process any further requests until the original processor heavy request is complete.

我最初想知道如何解决这个问题,但后来认为这可能不是一个好主意.

I originally wanted to know how I could get around this issue, but have since decided that it might be a bad idea in general.

但是,我仍然很好奇是否有人知道 apache 的行为方式,以及什么(如果有)配置指令控制它.我最初的想法是 KeepAlive,但禁用它似乎并没有改变行为.

However, I'm still curious if anyone knows why apache behaves this way, and what (if any) configuration directive controls it. My original thought was KeepAlive, but disabling that didn't seem to change the behavior.

如果有区别,我正在通过 mod_php 运行 php.

I am running php through mod_php if that makes a difference.

感谢任何帮助指出正确方向!

I appreciate any help getting pointed in the right direction!

推荐答案

您是否在使用基于文件的会话?PHP 将为每个请求锁定会话文件并保持该锁定,直到您执行 session_write_close() 或脚本终止/退出.这样做的副作用是所有请求都变成串行请求,因为它们都在争夺同一个资源(会话文件).

Are you using file-based sessions? PHP will lock session files for each request and maintain that lock until you do a session_write_close() or the script terminates/exits. The side effect of this is that all requests become serial, since they're all contending for the same single resource (the session file).

这篇关于为什么apache不能同时处理来自同一个浏览器的多个请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆