如何重写阿帕奇保活头使用PHP? [英] How to override Apache keep-alive header using php?

查看:96
本文介绍了如何重写阿帕奇保活头使用PHP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的httpd.conf有:

in my httpd.conf there is:

KeepAliveTimeout 1

我试图重写阿帕奇的KeepAliveTimeout在 php脚本设置(不是整个服务器),所以我有一个PHP脚本:

I'm trying to override Apache KeepAliveTimeout setting in a single php script (not in the entire server) so I have a php script with:

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

但它似乎没有任何区别。我仍然得到了响应:

but it doesn't seem to make any difference. still I get in the response:

Keep-Alive:timeout=1, max=50

任何想法如何解决此问题?

any ideas how to solve this?

推荐答案

您不能这样做。它的存在到位的正当理由。

You can't do that. It's there in place for a valid reason.

阿帕奇V2.2的核心功能

的秒数Apache将等待前一个后续请求
  关闭连接。一旦请求被接收,则超时
  通过在超时指令指定的值适用。

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.

设置的KeepAliveTimeout ,以一个较高的值可能会导致性能
  在重仓服务器的问题即可。越高超时,越
  服务器进程将保持占用等待与连接
  空闲客户端。

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.

这篇关于如何重写阿帕奇保活头使用PHP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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