We use http://pear.php.net/package/Benchmark , it is simple but it works -Nick
On Jul 7, 10:17 am, Graham Ramsay <[email protected]> wrote: > Hello PHP gurus, > > One of our customers websites is causing occasional sustained load on > our server. It is a custom PHP solution that we have worked on over > the past couple of years. We'll notice that the particular server is > responding slowly and investigate to find that Apache is taking a fair > chunk of CPU (close to 100% across the CPU's). This tends to fix > itself after a few minutes but meantime the time to serve requests > from that server is not acceptable. > > We have access to the HTTP logs of course, and can run commands as > root on the server (ps, top etc) but in order to track it down it > would be great if we could monitor PHP CPU usage. > > Questions: > > 1. Is there a way to find out how long each PHP request takes without > modifying existing code? > 2. If we were to modify the code, are there any special things that we > need to do (e.g. do we need to play around with > register_shutdown_function for logging, and how robust is it for this > kind of thing?) > > Any help appreciated, > > Graham. --~--~---------~--~----~------------~-------~--~----~ NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected] -~----------~----~----~----~------~----~------~--~---
