perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John ORourke <>
Subject Re: Apache::DProf giving empty tmon.out files
Date Mon, 21 Jan 2008 12:17:41 GMT
Alx G wrote:
> I'm running Apache 2.2.3, the conf has the following in it:
> --
> ...
> LoadModule perl_module modules/
> # Perl profiler
> #
> #<Perl>
> #    require Apache::DB;
> #    Apache::DB->init;
> #</Perl>
> PerlModule Apache::DProf
> ...
> --
> I tried with and without the commented stuff - as was suggested in this
> thread.

I'm running prefork and have used DProf many times.  I even wrote a 
script to merge multiple tmon.out files, so you can see how your app is 
doing in its normal environment.

The lack of recording happens when you don't do Apache::DB->init, and 
you also need to explicitly create the 'dprof' directory in your apache 
log directory, and make the apache user own it.

----------------------- perl config include:
    require Apache::DB;
    Apache::DB->init; # required otherwise very few subroutine calls get 
PerlModule Apache::DProf

----------------------- files:
(replace /var/log/httpd with your main log file path)

/var/log/httpd/dprof/   ********** you have to explicitly create this, 
and make it owned by the apache user

/var/log/httpd/dprof/PID/tmon.out   <----- output from a particular 
process (where PID is the pid)

Once you've let it run and made a few requests (make lots of requests so 
any heavy startup code doesn't overshadow the real results, and so each 
process gets a go), merge the tmon.out files using this script:

(see top of file for usage)

hope that helps,

View raw message