简体   繁体   English

如何在Apache日志中查看请求处理时间,而非请求服务时间

[英]How to see in Apache logs request processing time, not request serving time

There is an Apache 2 server choking under multiple requests. 在多个请求下有一个Apache 2服务器阻塞。 Amount of processes reaches number set by Maxclient, and new connections pile up in queue. 进程数量达到Maxclient设置的数量,并且新连接堆积在队列中。 I need to identify which requests take too much time x amount of requests. 我需要确定哪些请求花费太多时间x大量请求。 Apache logs may show either: Apache日志可能显示:

%...D The time taken to serve the request, in microseconds. %... D服务请求所花费的时间,以微秒为单位。

or 要么

%...T The time taken to serve the request, in seconds. %... T服务请求所花费的时间,以秒为单位。

And this time taken to serve the requests make it's hard to analyze. 这段时间请求提供服务使分析变得困难。 Because at the time when process table overflows is the time around which I need to measure. 因为在进程表溢出的时间是我需要测量的时间。 And there serve time equals time spent in connection queue plus time processed . 服务时间等于在连接队列中花费的 时间加上已处理的时间

So a .php script which took 2 seconds will show 2 seconds. 因此,花费2秒的.php脚本将显示2秒。 And .cgi script which spent minute (real data ;)) in queue will show 60.5 seconds. 在队列中花费数分钟(实际数据;)的.cgi脚本将显示60.5秒。

Is there a way to log time taken to process requests, preferably not involving engaging with hooks? 有没有一种方法可以记录处理请求所花费的时间,最好不涉及使用钩子?

这可能就是您想要的东西: https : //code.google.com/p/mod-log-firstbyte/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM