启用apache响应时间日志指令的性能影响

时间:2009-10-29 16:13:21

标签: performance apache monitoring logging response-time

启用响应时间(%D)LogFormat指令对apache性能有什么影响?

响应时间是以微秒为单位提供请求所需的时间。

响应时间可以这样启用:

#LogFormat "%h %l %u %t \"%r\" %>s %b"    # Default LogFormat
LogFormat "%h %l %u %t \"%r\" %>s %b %D"  # LogFormat including response time

我编写了一个监视和分析后端脚本性能的工具, apache-response-time,需要响应时间数据。我想警告潜在用户如何启用此指令将影响Apache服务器性能。

1 个答案:

答案 0 :(得分:6)

在HTTP响应方面可能不值得考虑 - 只有1 addl gettimeofday()调用(以及一些函数调用)的开销,所以大约几微秒。当请求到达时,Apache已经注意到了同样的事情。

http://www.atl.lmco.com/projects/QoS/POSIX_html/index.html列出了gettimeofday()本身的一些旧的微基准测试。