i tried pmap pgrep apache2 |grep total on ubuntu 10.4 running Apache and the o/p was like this:

total 47768K

total 48048K

total 48048K

total 48048K

total 48048K

total 48048K

does this means that each child process is taking 48 MB of RAM.Can you help me in finding the exact memory usage of each process.Expecting a reply

link|improve this question
feedback

2 Answers

You really don't want to know how complicated it is to work out what the actual memory footprint is.

Try plotting

ps -ef | grep httpd | wc -l

(number of httpd process)

against the first number in

free | grep 'buffers/cache'

(amount of memory used).

For varying load levels.

Remember that cache is important - if your webserver does any I/O then it the less cache you have the slower it will go. As a rough rule of thumb you want to set your maxclients to a value less than where 80% of your memory is used up.

link|improve this answer
feedback

This is what I use for an approximation of the average httpd (substitute apache2 if on Debian distro) process size:

ps -ylC httpd --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'

Like symcbean said you should take about 80% of the server's memory and divide it by the average process size to determine your upper limit MaxClients.

Cheers

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.