Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

mod_perl application debugging

by dda (Friar)
on Nov 14, 2003 at 16:10 UTC ( [id://307083]=perlquestion: print w/replies, xml ) Need Help??

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

Hi Monks!

I'm trying to debug a mod_perl application. I set up the following stuff in startup.pl:

$ENV{PERLDB_OPTS} = "NonStop=1 LineInfo=/tmp/db-$$.out AutoTrace=1 fra +me=1"; use Apache::DB;
Also I specified PerlFixupHandler Apache::DB in httpd.conf for location to be traced.

After getting a simple screen (template-based) I analyzed logfile created in /tmp. It had a size of 32 Mb, and I waited about 10 minutes while it was created. I filtered out only lines containing the word 'entering', trying to get called subroutines list, and saved them to the file 'subs.log'. Look:

[root@linux tmp]# wc -l subs.log 43986 subs.log [root@linux tmp]# grep -i parse::recdescent subs.log |wc -l 35769
Below is a typical fragment of the flow:
entering Parse::RecDescent::Rule::expected entering Parse::RecDescent::Production::expected entering Parse::RecDescent::Subrule::describe entering Parse::RecDescent::Rule::_contains entering Parse::RecDescent::Production::expected entering Parse::RecDescent::Subrule::describe entering Parse::RecDescent::Rule::_contains entering Parse::RecDescent::Production::expected entering Parse::RecDescent::Subrule::describe entering Parse::RecDescent::Rule::_contains entering Parse::RecDescent::Expectation::new entering Parse::RecDescent::Expectation::at entering Parse::RecDescent::LineCounter::TIESCALAR entering Parse::RecDescent::Expectation::is entering Parse::RecDescent::Expectation::at entering Parse::RecDescent::namespace000001::function_name entering CODE(0x815294d8) entering Parse::RecDescent::Rule::expected entering Parse::RecDescent::Production::expected entering Parse::RecDescent::Token::describe entering Parse::RecDescent::Rule::_contains entering Parse::RecDescent::Expectation::new entering Parse::RecDescent::Expectation::at
As you can see, more than 80% of calls are calls to Parse::RecDescent. Is it normal? Is such a large size of trace file normal? And number of calls to produce a single page in general?

Please forgive my bad English.

--dda

Replies are listed 'Best First'.
Re: mod_perl application debugging
by perrin (Chancellor) on Nov 14, 2003 at 18:08 UTC
    What were you trying to find out with the debugger? If you want to know where the time is being spent, Apache::DProf would be better. When I use the debugger, I usually am looking for something specific, so I use it interactively. You can do that with Apache::DB if you run httpd with -X.
      That's a good question :)

      I have to locate several problems with the code: circular references between obects, places where destructor should be called but it is not called, etc. Is there a better way to do it?

      And thank you for pointing me to Apache::DProf module!

      --dda

Re: mod_perl application debugging
by rdfield (Priest) on Nov 14, 2003 at 16:51 UTC
    Is it normal?
    No.
    Is such a large size of trace file normal?
    No.
    And number of calls to produce a single page in general?
    If by this you mean "what number of calls to Parse::RecDescent is normal in mod_perl applications is normal?", then the answer is none.

    What templating engine are you using?

    rdfield

      I use HTML::Template::Expr module. Actually, the code was not written by me, but I suppose it is heavily dependent on this module.

      --dda

Re: mod_perl application debugging
by Anonymous Monk on Nov 14, 2003 at 17:02 UTC
    Have you ever use Parse::RecDescent before? I wouldn't use it in a mod_perl environment.
      No, I haven't used this module before. Why do you prefer not to use it in mod_perl environment? Please explain.

      --dda

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://307083]
Approved by talexb
Front-paged by Courage
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-03-28 18:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found