Ubuntu – Why is Apache running so many processes? Excessive RAM here

apache-2.2memoryperformanceUbuntu

I notice Apache is running multiple processes on my LAMP server (ubuntu 10.10). I'm just running a WordPress site with MySQL as a database. It seems like www-data is running apache2 more than it should (using too much memory too), am I correct:

ID      Owner       Size        Command   
31200   www-data    251236 kB   /usr/sbin/apache2 -k start
20678   www-data    250948 kB   /usr/sbin/apache2 -k start
25781   www-data    248888 kB   /usr/sbin/apache2 -k start
31045   www-data    248844 kB   /usr/sbin/apache2 -k start
19926   www-data    246480 kB   /usr/sbin/apache2 -k start
20749   www-data    239380 kB   /usr/sbin/apache2 -k start
32616   www-data    238632 kB   /usr/sbin/apache2 -k start
8846    mysql   238128 kB   /usr/sbin/mysqld
24178   www-data    234228 kB   /usr/sbin/apache2 -k start
32618   www-data    232344 kB   /usr/sbin/apache2 -k start
32615   www-data    232204 kB   /usr/sbin/apache2 -k start
19805   root    208156 kB   /usr/sbin/apache2 -k start

Best Answer

Apache is running multiple processes to have them ready when a client request comes in. Spawning a server process is slow, so it's best to have one waiting for a client.

For memory usage, you should take into the account RES size (as displayed by top), which is the amount of physical memory used by the task.

Why do you think you have too many apache2 processes using too much memory? What do you expect? Why do you expect so?

Related Topic