rom_de_plume has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone have any suggestions on profiling CGI scripts? I've started playing with Devel::Dprof, but everytime my CGI runs it overwrites the tmon.out file. My CGI has multiple frames, so it gets called several times for every page, overwriting the tmon.out file everytime. I'd like to get some kind of cumulative statistics for several for where the CGI is spending its time while I go through several screen of the CGI application.

I was wondering if anyone had any suggestions on using Devel::Dprof with CGI scripts, or any other suggestions on profiling a CGI script.

Replies are listed 'Best First'.
Re: Devel::Dprof and cgi scripts
by bikeNomad (Priest) on Jun 06, 2001 at 03:27 UTC
    You can set the name of the file using the environment variable PERL_DPROF_OUT_FILE_NAME. Perhaps you could make unique ones based on session ID's?
      Wouldn't the session ID be the same on Apache for each page in the frame? It seems to me that the file would still get overwritten because the name based on the session ID would still be the same.
Re: Devel::Dprof and cgi scripts
by LD2 (Curate) on Jun 06, 2001 at 05:11 UTC
    You may also want to look into Devel::SmallProf. But, you may run into similar problems with the output file..I'm not really sure.