Randy,
Thanks so much for the tips. I got Apache::VMonitor - awesome package, Stas
- and investigated it further. What I found was that each child loses a
small amount of shared memory during normal use, due to copy-on-write. In
my case from about 12M to 9M (roughly 25%). But it stabilizes at 9M shared,
and then all of a sudden *all* of the child processes + the parent drop to
3M shared. All of them at once.
Could this be due to swapping? (my site is currently very low traffic) I
did notice that I could not actively cause the shared memory to dip below
9M. I had to wait a few minutes, and reload VMonitor after a period of no
activity.
I couldn't test exiting the Apache child, since it isn't a gradual dropoff.
BTW, how do you terminate an Apache child process from within mod_perl?
Thanks,
- Adi
Randy Harmon wrote:
>
> On Wed, Oct 20, 1999 at 10:47:02PM -0700, Adi wrote:
> > > On Wed, 20 Oct 1999, Remi Fasol wrote:
> > Does anyone know why the shared memory would decrease so dramatically?
>
> Perl code and data both live in the data segment. As it is used, any time
> it writes information into a new chunk of memory, the memory is
> copied-on-write, becoming not-shared.
>
> You may or may not benefit from exiting your Apache child when its shared
> memory size shrinks too much. I think a package of Stas Bekman's
> authorship may help you detect that occasion. It wraps the gtop library in
> perl, so you can monitor 'top' info from mod_perl.
>
> Your own tests will give you an indication of whether this saves memory and
> should also indicate whether there is any performance advantage one way or
> other.
>
> It'd be interesting to hear your story of the results.
>
> Randy