2

I have a LAMP server that uses ubuntu 9.10, apache2, mysql5 and php5.

When I login as root through the shell, I run a "ps aux" command and see something like the following

www-data  3151  0.1  4.3 220024 31032 ?        S    12:22   0:00 /usr/sbin/apache2 -k start
www-data  3153  0.2  3.6 214776 26020 ?        S    12:22   0:01 /usr/sbin/apache2 -k start
www-data  3162  0.3  5.1 225060 36920 ?        S    12:26   0:01 /usr/sbin/apache2 -k start
www-data  3163  0.1  4.1 218872 29664 ?        S    12:26   0:00 /usr/sbin/apache2 -k start

How come I see multiple lines for www-data? Does each line represent an actual user on my website?

I run into memory issues at times, so I'm trying to determine if these www-data statistics are related.

2 Answers 2

6

Apache by default on most Linux distros uses a preforking worker module. This spawns multiple processes, which each handle some of the requests.

Apache keeps a number of processes ready and waiting to reduce latency/overhead of forking a new process - these are the extra lines you see in ps.

The processes you see don't directly map 1:1 to users/requests.

http://httpd.apache.org/docs/2.2/mod/prefork.html covers this in a lot more detail.

To check which worker module you are using on Ubuntu/Debian, run apache2 -V and look for the APACHE_MPM_DIR line. Or run dpkg -l | grep apache - each MPM is a different package.

1

Apache runs several processes. For more details read http://httpd.apache.org/docs/2.2/mpm.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .