perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Measuring response time Apache request
Date Tue, 24 May 2011 16:20:23 GMT
marco wrote:
> Il 24/05/2011 17.35, Adam Prime ha scritto:
>> On 11-05-24 11:30 AM, marco wrote:
>>> Hi all,
>>> I want to get the response time that Apache spends to serve a request
>>> (from post-read-request phase to the response phase).
>>> Any idea?
>>> Thanks
>> I'm pretty sure there are messages buried in the archives (from 
>> torsten) showing how to do this with $r->push_handlers and Time::HiRes 
>> (or something along those lines).  It's not really that complicated 
>> though, you basically just have a PostReadRequestHandler that uses 
>> push_handlers to push a handler into every phase that just logs the 
>> current time, or whatever it is you want to log.
>> Adam
> Hi Adam,
> I'm in this list only since 2 weeks. Can you tell me where can I find 
> this mails?
> Thanks a lot.

To answer you last question :

Go to :
On the left side, there is an item : Mailing lists
This leads you to the :  	mod_perl Users mailing list
This leads you to the : Searchable archives
where you have a choice of searchable archives.
and have a look for example at ""

Apart from that, and for the main issue :

Is it not easier to just read the Apache access log a posteriori, and filter the lines 
which you need ?
With the appropriate LogFormat, you can have the microseconds needed for each request.

See :
(parameter %D)

LogFormat "%a - %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined_ip
CustomLog /var/log/apache2/somehost/access.log combined_ip

Sample log line with the above format (server name changed for privacy) : - U367532 [24/May/2011:17:49:05 +0200] "POST /starweb/OPAC/servlet.starweb

HTTP/1.0" 200 28029 

"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727;

.NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; 
.NET4.0C; .NET4.0E)" 147626

(the last number is the number of microseconds needed to process that request)

View raw message