4
I have some scripts that do a data Mining job, and in some cases need to run long processes that can consume a lot of CPU. I need to find a command via SSH to monitor all running PHP scripts. Something like:
watch ps -F -C php-cgi ...
but it doesn’t work for me.
It depends on many factors. When running under a webserver, Apache, for example, will display the "httpd" process. When you run via CLI, the compiler path is displayed and not the file that was invoked. For more control, look over Signal Handler: http://php.net/manual/en/function.pcntl-signal.php. Only be aware of which functions
pcntl
usePOSIX
, so it doesn’t work under Windows environment. See also http://php.net/manualen/event.addsignal.php. No time to post as response. For it requires a relatively long answer.– Daniel Omine
@Eduardo are you running Phps standalone (via shell)? No
ps- aux
you see the processes separately?– Bacco
Scripts are executed in the background using
&
? If yes, you can use the commandjobs
orjobs -l
to list commands running in the background.– Edson Horacio Junior