getting total apache mem usage

From: Terry Ewing (sun@deadtrout.com)
Date: Thu Dec 05 2002 - 14:46:05 EST


All,
   I'm writing a script that calculates the total apache memory usage in
Solaris 8. Apache forks children and I'm unsure if what I see in top is
accurate memory usage. I'm not sure if there are shared memory segments
created by the parent and used by the child that are being included in this
number.

   Here are my questions:

   1) Does Apache accurately report memory usage in ps for the child
processes?
        The reasons I ask are, I've heard that if many mallocs are issued,
then many frees are issued the kernel may still report that memory as being
used by the process until it is claimed by another process. Shared memory
segments may be included in each processes memory usage. Also, when a fork
is done, I've read that the kernel only mallocs it's own copy if the parent
or child changes it. While that last part makes sense I don't really
believe it.

   2) I'm thinking of doing ps -ey |grep http and then parsing the output.
Is there a better way of getting it from /proc or some such way?

Ultimately, I'm just going to calculate a total apache usage and an average
size of child processes and return them to snmpd. Our head end unit will
collect this data for each of our servers and graph it and alert on crossing
thresholds.

Thanks,
-Terry
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:25 EDT