Bill Marrs wrote:
> But... recently, something happened, and things have changed.  After 
> some random amount of time (1 to 40 minutes or so, under load), the 
> parent httpd suddenly loses about 7-10mb of share between it and any new 
> child it spawns.

One possible reason is that a perl memory structure in there might be 
changing.  Perl is able to grow variables dynamically by allocating 
memory in buckets, and it tends to be greedy when grabbing more.  You 
might trigger another large allocation by something as simple as 
implicitly converting a string to a number, or adding one element to an 
array.

Over time, I always see the parent process lose some shared memory.  My 
advice is to base your tuning not on the way it looks right after you 
start it, but on the way it looks after serving pages for a few hours. 
Yes, you will underutilize the box just after a restart, but you will 
also avoid overloading it when things get going.  I also recommend 
restarting your server every 24 hours, to reset things.

One more piece of advice: I find it easier to tune memory control with a 
single parameter.  Setting up a maximum size and a minumum shared size 
is not as effective as setting up a maximum *UNSHARED* size.  After all, 
it's the amount of real memory being used by each child that you care 
about, right?  Apache::SizeLimit has this now, and it would be easy to 
add to GTopLimit (it's just $SIZE - $SHARED).  Doing it this way helps 
avoid unnecessary process turnover.

- Perrin

Reply via email to