I am running apache2 with mod-fcgid, suexec and SysCP. From time to time, the apache process gets stuck using 100% CPU on one core on my server. The apache is also unable to handle any additional requests in this state. I need to kill -9 the process manually in these situations. Since it's the apache2 process under its global user crashing, and not a fcgid with an project-specific user id, I can't even see, which code is causing the crash. What would be a good strategy to nail the cause of this behavior?
If you have access to apache httpd.conf, you can enable and configure mod_status with your IP and when the process starts taking the cpu, load up the page and search for processID