Analyze PHP page and outline why it takes approx 20 seconds to parse.
Here is the work I have already done:
I have used getmicrotime() throughout the script to try to identify the areas taking a long time to execute. My MySQL queries are not the problem, they are all fast. I have limited the possible area to one while() loop, which iterates about a dozen times. The strange part is that sometimes this entire loop takes only 1-2 ms to execute, sometimes it takes up to 2 seconds! When I refresh the page, the time it takes for the loop iteration to execute changes -- it is never the same. So I don't think it is anything in the code -- maybe it is a performance flaw in the server? In any case, even though the while() loop is nearly random in how long it takes, the entire script is fairly contant at 17-19 seconds to execute.
My server load is never higher than about 5%, so it is not a lack of ability of the server. The server is a dual [url removed, login to view] Xeon with [url removed, login to view] interleaved DDR memory.
1) Explanation of long parse time and detailed optimization solution
Redhat 9.0, PHP 4.2.2, MySQL [url removed, login to view]