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

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

am 18.05.2011 13:45:15 von Raf

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 withDevel::NYTProf::Apache

am 20.05.2011 13:00:24 von rafiq

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.

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

am 20.05.2011 18:39:14 von Fred Moyer

On Fri, May 20, 2011 at 4:00 AM, Raf 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. =A0I use the following pattern:
>>
>> * start backgrounded httpd process with start=3Dno (explicitly enabled l=
ater
>> 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. =A0It
> 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 als=
o
> seems to intmittently fail to be invoked.. =A0At a loss as to why Apache =
is
> not cleanly shutting down? =A0It appears that the cleanup phase is being
> skipped and the embedded intrepreter is not being cleanly exited. Has any=
one
> 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