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.

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.

  • 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 '11 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 '11 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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