You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by ra...@dreamthought.com on 2011/05/18 13:45:15 UTC

Kill signals against single process daemon with Devel::NYTProf::Apache

I am trying to profile mod-perl processes in a single process httpd
with Devel::NYTProf::Apache.  I use the following pattern:

* start backgrounded httpd process with start=no (explicitly enabled later
in the code)
* request url against appropriate port
* send TERM signal to apache pid
* nytproftohtml the profiled output

I've witnessed situations where non-200 responses, specifically timeouts,
are causing the profile output not to be properly processed, yielding an
unparsable state and the following error:

"Profile data incomplete, inflate error -5 ((null)) at end of input file,
perhaps the process didn't exit cleanly or the file has been truncated
(refer to T)"

It is my inference that this correlates with timeouts at present.  I have
also potentially observed that when setting MaxRequests to a reachable
figure this might be cleanly closing the profile output.

Any suggestions would be welcome.  I'd ideally like to insure that the
profiling output may be fully generated without any further intervention
to the profiled codebase.

Suggestions?

R.



Re: Kill signals against single process daemon with Devel::NYTProf::Apache

Posted by Fred Moyer <fr...@redhotpenguin.com>.
On Fri, May 20, 2011 at 4:00 AM, Raf <ra...@joshua.dreamthought.com> wrote:
>
> On Wed, 18 May 2011, rafiq@dreamthought.com wrote:
>
>> I am trying to profile mod-perl processes in a single process httpd
>> with Devel::NYTProf::Apache.  I use the following pattern:
>>
>> * start backgrounded httpd process with start=no (explicitly enabled later
>> in the code)
>> * request url against appropriate port
>> * send TERM signal to apache pid
>> * nytproftohtml the profiled output
>>
>> "Profile data incomplete, inflate error -5 ((null)) at end of input file,
>> perhaps the process didn't exit cleanly or the file has been truncated
>> (refer to T)"
>>
>
> Trying again in the hope that someone might be able to shed light.  It
> appears that END blocks are not being invoked and so I explicitly placed a
> finish_profile() in the DESTROY method of my top level handler - this also
> seems to intmittently fail to be invoked..  At a loss as to why Apache is
> not cleanly shutting down?  It appears that the cleanup phase is being
> skipped and the embedded intrepreter is not being cleanly exited. Has anyone
> witnessed this through nothing other than the injection of
> Devel::NYTProf::Apache (4.06) profiling.

1st recommendation - upgrade your Apache and mod_perl versions, both
are a couple years out of date.

2nd recommendation - search the mailing list archives, I recall
something similar to this that Tim Bunce had encountered while working
on NYTProf.

>
> Apache version: Apache/2.2.3
> mod_perl: 2.0 (Apache2::RequestRec::VERSION - 2.000004)
> interpretter: (64bit 5.8.8)
> Devel::NYTProf: 4.06

Re: Kill signals against single process daemon with Devel::NYTProf::Apache

Posted by Raf <ra...@joshua.dreamthought.com>.
On Wed, 18 May 2011, rafiq@dreamthought.com wrote:

> I am trying to profile mod-perl processes in a single process httpd
> with Devel::NYTProf::Apache.  I use the following pattern:
>
> * start backgrounded httpd process with start=no (explicitly enabled later
> in the code)
> * request url against appropriate port
> * send TERM signal to apache pid
> * nytproftohtml the profiled output
>
> "Profile data incomplete, inflate error -5 ((null)) at end of input file,
> perhaps the process didn't exit cleanly or the file has been truncated
> (refer to T)"
>

Trying again in the hope that someone might be able to shed light.  It 
appears that END blocks are not being invoked and so I explicitly placed a 
finish_profile() in the DESTROY method of my top level handler - this also 
seems to intmittently fail to be invoked..  At a loss as to why Apache is 
not cleanly shutting down?  It appears that the cleanup phase is being 
skipped and the embedded intrepreter is not being cleanly exited. Has 
anyone witnessed this through nothing other than the injection of 
Devel::NYTProf::Apache (4.06) profiling.

Apache version: Apache/2.2.3
mod_perl: 2.0 (Apache2::RequestRec::VERSION - 2.000004)
interpretter: (64bit 5.8.8)
Devel::NYTProf: 4.06

Thoughts appreciated.
Thanks,

R.