加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

如何使用PHP覆盖Apache keep-alive头?

发布时间:2020-12-13 16:21:13 所属栏目:PHP教程 来源:网络整理
导读:在我的httpd.conf中有: KeepAliveTimeout 1 我试图在一个PHP脚本(不是整个服务器)中覆盖Apache KeepAliveTimeout设置,所以我有一个PHP脚本: header("Keep-Alive: timeout=60,max=100"); 但它似乎没有任何区别.我还是得到了答复: Keep-Alive:timeout=1,max
在我的httpd.conf中有:

KeepAliveTimeout 1

我试图在一个PHP脚本(不是整个服务器)中覆盖Apache KeepAliveTimeout设置,所以我有一个PHP脚本:

header("Keep-Alive: timeout=60,max=100");

但它似乎没有任何区别.我还是得到了答复:

Keep-Alive:timeout=1,max=50

任何想法如何解决这个问题?

解决方法

你不能这样做.它是有正当理由的.

Apache v2.2 Core Features

KeepAliveTimeout指令

The number of seconds Apache will wait for a subsequent request before
closing the connection. Once a request has been received,the timeout
value specified by the Timeout directive applies.

Setting KeepAliveTimeout to a high value may cause performance
problems in heavily loaded servers. The higher the timeout,the more server processes will be kept occupied waiting on connections with idle clients.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读