I've been using Apache::DProf to figure out where my code in mod_perl is running slow. There are some socket calls out to other services, so I used '-r' to measure real time as opposed to cpu time. My::Apache::Handler::handler calls several subroutines, but I haven't been able to get dprofpp to tell me how much time it is spending in those subs.

I've gone over the docs, and the writeup at perl.com, but have come up empty. I've started to use dtrace, but I'd really like to be able to figure out what I need to know with dprofpp. I've tried SmallProf but it didn't play nice with my application.

Any suggestions?

Total Elapsed Time = 292.7386 Seconds Real Time = 292.7386 Seconds Exclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 0.32 0.928 -0.226 3 0.3093 0.0753 My::Handler::handler 0.01 0.039 0.038 2 0.0194 0.0190 DBD::Pg::dr::connect 0.01 0.033 0.074 1 0.0325 0.0743 Apache::DBI::childinit 0.01 0.020 0.020 1 0.0199 0.0199 utf8::AUTOLOAD 0.00 0.005 0.005 38 0.0001 0.0001 DBI::common::DESTROY 0.00 0.000 0.000 1 0.0000 0.0000 Socket::__ANON__ 0.00 0.000 0.000 1 0.0000 0.0000 HTTP::Message::__ANON__ 0.00 - -0.000 1 - - Compress::Raw::Zlib::infl +ateStream 0.0001 ::DESTROY 0.00 - -0.000 1 - - My::Model::Foo::BEGIN 0.00 - -0.000 1 - - warnings::import 0.00 - -0.000 2 - - utf8::SWASHNEW 0.00 - -0.000 1 - - APR::Pool::DESTROY 0.00 - -0.000 1 - - vars::import 0.00 - -0.000 1 - - warnings::unimport 0.00 - -0.000 2 - - Template::Context::stash

p.s. - I'm using Apache::DProf, not Devel::Profiler::Apache because I'm using mod_perl2.

SOLVED - I was doing 'use Apache::DProf' in my startup.pl instead of PerlModule Apache::DProf in my httpd.conf. I added a PerlSection also, here is the total code now:

LoadModule perl_module modules/mod_perl.so <Perl> require Apache::DB; Apache::DB->init; </Perl> PerlModule Apache::DProf

I had this stuff loading conditionally in startup.pl if My::Config->profile was set to true. Sucks to be me, but I'm glad it is working now. Thanks for your help again Monks.


In reply to Measuring mod_perl with Apache::DProf by redhotpenguin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.