0

When I run a PHP script through browser ( HTTP connection) the PID is printed for debugging, but when this request is closed by clicking the browser's Stop button, or closing this browser tab, I still see the process when I run ps -aux in terminal.

www-data 2613 0.0 1.2 42320 12968 ? S 17:14 0:00 /usr/sbin/apache2 -k start

How long this process will keep lurking for no reason? And should one worry about many of those zombies in production? Given that, the PHP script does nothing but printing the PID, sleeps for 5 seconds, and then ends.

1 Answer 1

2

It generally isn't something to worry about. Each process handles multiple http requests as standard.

If you are seeing more than 20 then there could be a problem. The default on most distros is between 10 and 20 spare apache servers.

2
  • by running ps -aux | grep apache2 | wc -l it always gives a number between 10 and 20. I know know what is Apache worker process also. Thanks!
    – doc_id
    May 1, 2011 at 16:15
  • 1
    @rahmanisback: you can see how many instances will run (max, min, etc) in your apache2.conf. For example (in a debian/ubuntu server): sed -n '/mpm_prefork_module/,/IfModule/{p}' /etc/apache2 will show you the numbers
    – hmontoliu
    May 1, 2011 at 16:36

You must log in to answer this question.

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