I'm trying to find the bottlenecks and I'm currently logging the time in the script but it seems to be random times for certain operations. Is there a tool that will allow me to see the breakdown of what's going on during a certain [apache] request to track down if the CPU is just burning the whole time or if it's waiting for something else?
feedback
|
|
This is a question of profiling; you need to hook up a profiling tool to the process and get it what's really going on. For really poor-man's profiling, I just attach to it using strace; using the timing flags ( | |||
|
feedback
|
|
If you're using a windows OS, then the free tools from SysInternals might be the best place to start. The Process Explorer tool is pretty good at watching the active processes, what's calling them, and what actions are taking place. SysInternals makes it pretty easy to download the SysInternals Suite of tools. It's kinda like an American Express Card, don't leave home with it. Hope this helps some. | |||
|
feedback
|
|
Something else to check, If you're able, is to monitor the server's performance. Maybe your disk queues are spiking, maybe you have a failing drive in the RAID, maybe you are running out of memory, etc... | |||
|
feedback
|
|
You can see some more detail with a tool like procstat. You feed it a PID and it decodes the /proc/$pid/stat file which can tell you some interesting internals stuff, like number of CPU jiffies it has used, or its children have used. | |||
|
feedback
|