Welcome to WebmasterWorld Guest from 126.96.36.199
I have built a php script and am using it on my apache server (php version 4 and red hat linux).
The problem that I am facing is that whenever I use the "top" command via ssh on my server, it shows a stuck httpd request due to these php scripts. The request remains stuck for an unforeseen time, increases memory usage and thus increases server load and processing power. Not just 1, there are several such httpd requests running for a very long time and I could say that they terminate only when I do a apache restart.
I have even tried using mysql_free_results, but even that does not seem to work. Any tips on how do I go about debugging this problem.
Next, try to start debugging actual script execution times.
At the top:
As the last two lines:
if ($duration>5) error_log("Long running script - took $duration sections");
You should then be able to view your error_log and see exactly how long the slow scripts are taking. From there, try to work backwards ... error_log $_GET arguments, user IDs, etc. until you find out what is special about these particular executions.