I am working on optimizing my site, and I have had the MySQL slow queries log on for a few days now, but after going through >260M queries, it only logged 6 slow queries, and those were special ones executed by me on phpMyAdmin. I am wondering if there is something to log slow PHP page execution time so that I can find certain pages that are hogging resources, rather than specific queries.
Share
First, there is xdebug, which has a profiler, but I wouldn’t use that on a production machine, since it injects code and brings the speed to a crawl. Very good for testing environments, though.
If you want to measure speeds on a productive environment, I would just to the measuring manually.
microtime()is the function for these things in PHP. Assuming you have a header.php and a footer.php which get called by all php scripts: