长请求阻塞 Apache 和 PHP 中的其他请求 [英] Long request blocks other requests in Apache and PHP

查看:23
本文介绍了长请求阻塞 Apache 和 PHP 中的其他请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大约需要 1.5 分钟才能完成的请求,但是当它执行请求时,它会阻止服务器的所有其他请求.我正在使用带有 mod_php 的 Apache.解决这个问题的最佳方法是什么?谢谢!

I have a request that takes about 1.5 minutes to complete, but when it does the request, it blocks all the other requests by the server. I'm using Apache with mod_php. What's the best way to fix this? Thanks!

推荐答案

[mod_telepathy]

你使用会话吗?如果是这样 - 当你没有在长脚本中关闭会话时,其他人会等待它.

Do you use sessions? If so - while you haven't closed session in long script, others will wait for it.

如果您不需要一直在那里进行会话 - 您可以使用 session_write_close()

If you don't need session there all the time - you can close it with session_write_close()

[/mod_telepathy]

这篇关于长请求阻塞 Apache 和 PHP 中的其他请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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