Memory usage – Apache2 takes 94%

Hi,

After connecting to my new My Book Live 2TB, I ran a custom script to find out which process were eating all the 256Mo of ram.

Turn out I have 13 apache process running… and growing… each time I refresh the web page one or two new process are added. And %MEM for the new ones is always bigger…

I am not an apache expert. Is there any way to control this ? I was thinking of stopping apache. And then activating it by ssh each time I require to connect to the web interface. Which is not so frequent, once the setup is done.

Does anyone has sone advice to give ?

Here is the result :

topmem 13

COMMAND         %MEM

apache2         11.4

apache2          9.7

apache2          9.3

apache2          8.6

apache2          8.6

apache2          8.6

apache2          8.6

apache2          7.1

apache2          7.0

apache2          7.0

apache2          4.1

apache2          4.1

total : 94.1

#ps aux

root     12432  0.0  6.9  34048 17600 ?        S<s  17:58   0:00 /usr/sbin/apache2 -k start

www-data 12434  0.0  8.4  37568 21376 ?        S<   17:58   0:00 /usr/sbin/apache2 -k start

www-data 12435  0.0  8.4  37568 21376 ?        S<   17:58   0:00 /usr/sbin/apache2 -k start

www-data 12436  0.0  8.4  37568 21376 ?        S<   17:58   0:00 /usr/sbin/apache2 -k start

www-data 12437  0.7  9.1  41088 23296 ?        S<   17:58   0:06 /usr/sbin/apache2 -k start

www-data 12438  0.1  8.5  37824 21632 ?        S<   17:58   0:01 /usr/sbin/apache2 -k start

www-data 12535  0.1  9.0  37824 22976 ?        S<   17:59   0:01 /usr/sbin/apache2 -k start

www-data 13150  0.0  6.8  34432 17472 ?        S<   18:10   0:00 /usr/sbin/apache2 -k start

www-data 13151  0.0  6.8  34048 17408 ?        S<   18:10   0:00 /usr/sbin/apache2 -k start

www-data 13152  2.8 10.8  45440 27648 ?        S<   18:10   0:06 /usr/sbin/apache2 -k start

www-data 13483  0.0  4.1  34048 10496 ?        S<   18:12   0:00 /usr/sbin/apache2 -k start

yes… I noticed that too apache take too much resources on MyBook Live, so I just simply killed it cause it really not needed for advanced user. I think it was bad move for WD to run apache on MyBook Live. They should left something more less resources eating  like minihttpd on My Book World.

If I need simple / cool super small footprint webserver for file sharing on MyBook Live, I start mongoose ( http://code.google.com/p/mongoose/)..)

1 Like

Thanks for the advice.

I too did shut it down. When I need it, I start it again.

But I will consider using the light web server you recommend.

Thanks.

I wonder if your script is a bit wonky…

My apache2 processes are using 4% of memory TOTAL…

well, that’s a fair question. Please, tell me.

The result is just the sum of what ps aux tells me. (with some filters and awk magic)

Here is the script:

ps -A --sort -rss -o comm,pmem | head -n $1
echo "total $1:"
ps -A --sort -rss -o comm,pmem | head -n $1 | awk '{sum +=$2}; END {print sum}'

usage : topmem 10 to view the 10 most-memory-consuming process and the total mem% they use.