From another thread...
cout wrote:
Linux uses copy-on-write, so different instances of the same program can share memory.
I've just been looking into this myself, and it's frustrating me: I want to monitor Apache's and mysql's memory usage so I can do capacity planning. But I haven't found any way to figure out what is really being taken up, based on a report like this:
Code:
ps aux | grep apache
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1066 0.0 6.3 142304 3760 ? S Nov06 0:03 /usr/sbin/apache
www-data 16560 0.0 8.9 144104 5308 ? S 06:38 0:00 /usr/sbin/apache
www-data 16561 0.0 9.2 144672 5536 ? S 06:38 0:00 /usr/sbin/apache
www-data 16562 0.0 9.4 144320 5628 ? S 06:38 0:00 /usr/sbin/apache
www-data 16563 0.0 8.7 144108 5188 ? S 06:38 0:00 /usr/sbin/apache
www-data 16564 0.0 8.8 144112 5292 ? S 06:38 0:00 /usr/sbin/apache
www-data 16599 0.0 12.3 145868 7372 ? S 06:38 0:00 /usr/sbin/apache
www-data 16600 0.0 9.8 144372 5872 ? S 06:38 0:00 /usr/sbin/apache
www-data 16601 0.0 9.2 144020 5508 ? S 06:38 0:00 /usr/sbin/apache
www-data 16602 0.0 9.0 144068 5372 ? S 06:38 0:00 /usr/sbin/apache
(At least with mysql on my box, all of the processes report the same memory usage.)
I have no idea how much of all these figures is shared memory.
Should I really care? I'm thinking maybe I should just take an average of the memory stats for each thread, just to have something to look at over time (knowing it's not a real number). Then just monitor total system memory usage and make sure the linode isn't thrashing.
But that's not really a good way to predict when I'll need to get more RAM, or move mysql to another server to free up memory for Apache...
Anyone know a more exact method for doing this kind of planning? I've been all over google and usenet, and haven't found anything helpful. Is there another tool I should be using?
Thanks,
ged