On Sun, Nov 09, 2014 at 04:55:59PM -0800,
m...@nationstates.net wrote:
> Hello Tim!
Hi Max.
> I understand from the docs that NYTProf is not thread-safe. So when I try the above on a machine running
> Apache MPM worker, NYTProf simply does a lot of this:
>
> ~ init_profiler for pid 27194, clock 1, tps 10000000, start 0, perldb 0xf10, exitf 0x2
> ~ init_profiler done
> ~ enable_profile call from different interpreter ignored
> ~ finish_profile call from different interpreter ignored
> ~ enable_profile call from different interpreter ignored
> ~ finish_profile call from different interpreter ignored
>
> I'm writing in anyway because I'm holding onto the hope that this need not apply in my limited case,
> where I only want to start profiling after Apache has created a thread and finish profiling in that same
> thread. I don't need NYTProf to follow an Apache process through a fork or whatever it does. In fact, if
> it matters, I'd be happy to limit the profiling to a single grab from each MPM worker process--they get
> recycled reasonably often, so that would still provide enough profiling data to be useful. I just want
> to be able to sample live data.
>
> What do you think?
The "... call from different interpreter ignored" message means
"call from different interpreter than the first one that enabled profiling".
So the 1-in-N sampling could be some on the basis of 1-in-N requests
that are handled by that thread.
Another approach would be to use a FastCGI backend connected via a
filesystem socket. Then, whenever it suits you, you can simply start a
separate single-threaded FastCGI backend process connected to that socket.
> Thank you again for your marvellous software,
You're welcome.
Tim.