I've just tried it out on my linux x86_64 system with mod_perl 2.03 and apache 2.2.4 using a preforked MPM, and it works fine. You need to do the following:
- Install the latest Apache::DProf
- Make sure your mod_perl is version >=2
- Make sure that mod_perl has PerlChildInitHandlers enabled - for a stock install, I'm sure this would be the case
- Create the dir logs/dprof and make it writable by the user apache runs under
- Add PerlModule Apache::DProf into your httpd.conf file, or make it the first module loaded in your startup.pl file
- apachectl start should create a number of dirs under logs/dprof named after the process ID of each apache child, with a tmon.out file in each directory - I'm using
- Run a few requests that involve your mod_perl code
- Shut down the server - nothing will be written to the tmon.out files until the server shuts down (or the buffer fills up)
That's the process I followed, and it works. If this isn't working for you, then give us some more details of your apache, mod_perl and how you configured Apache::DProf.
Things to think about:
- Are you actually hitting mod_perl code?
- Are you looking at all the tmon.out files, because if you have 5 children, and make a few requests, they may all go to just one child, and so the profiling will be written to just one of the five tmon.out files.
- Are you using the preforked MPM or the threaded MPM? I don't know if it will make any difference, but threads and mod_perl can present problems that we don't normally see. It SHOULD work, but I haven't tried it.
- Are you loading Apache::DProf before any other modules? It doesn't mention it in the docs, and seems to work for me either way, but try it
Clint
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.