I have a Drupal 4.7.4 site that's crashing my server. Index.php is overloading the CPU. I've installed the devel module. The longest query execution time I can generate is under 650 ms. The most # of queries I can generate is under 350.
It's running on a virtual dedicated linux box with a pentium M, 2 gigs of ram, plenty of bandwidth and harddrive space. (Hardware isn't the issue.)
How can I go about identifying what script is causing this overload given the fact that the server's log only shows that index.php is overloading? (I don't have shell access.)
If someone were to hack the server and add an infinite loop or other php script somewhere in the code, how would I go about identifying it? The only custom code I run is phptemplate and one patch (aggregator_saving_categories).
My PHP is configured with a max execution time of 30 seconds. If there was some sort of malignant script, wouldn't it time out and generate a php error in the site's log before the CPU overloads?
What's the best way for me to get detail about the php scripts called by index.php? Is there a way to run the site with verbose error handling?
In the meantime, could I install a php.ini file that severely limits my php's CPU access to keep the site from crashing until I can get this resolved? I'll gladly give up my 2 second page load time to solve this problem.
Thanks,
Sean
Comments
Have you tried to disable
Have you tried to disable your modules which are not absolutely required by core one by one to find the offender? Or disable them all and enable them one by one?
It is hard to find the offender otherwise. It is like a village with 20 families sending their children to the market.
Hi I have not tried it yet
Hi
I have not tried it yet but I am sure you will get a lot of interesting info:
http://www.xdebug.org/docs-profiling.php
Thanks for the help
After a lot of work, what I've figured out is that my front page, which uses panels and a couple of views, just runs really high and stresses my server's CPU a bit. I'm working to clean up this code and look into ways to run these scripts more cleanly.
I also figured out that some screwy stuff was going on with my hosting service....I'm in the process of changing hosts and hopefully these problems will be less of an issue.
Thanks for the help!
Sean Larkin