I have a PHP script that will use exec to run commands on the server. The idea is that it'll monitor a PDF generation script on our server. I'm running into an issue where when the PDF generation process is stalled it takes up 98% CPU usage and the PHP script doesn't run. The PHP is supposed to kill the stalled PDF services.
What should I do to resolve this? What are some other solutions?