Forum Moderators: coopster

Message Too Old, No Replies

How to trace the behaviour of my PHP resources consumption

         

guarriman

5:22 pm on Nov 19, 2007 (gmt 0)

10+ Year Member



Hi.

My PHP application runs very slow and would like to know if it exists a method to trace in which part of my PHP scripts I consume more resources.

For instance, I've seen some websites showing SQL queries made.

Any suggestion?

coopster

3:22 pm on Nov 27, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



If your database system has a query log you can check there first ... for example, the MySQL database has a slow query log that you can monitor.

Another practice I often find helpful is the ability to log queries myself during development. You can set a flag in your database extraction layer (basically a centralized function that executes all your queries) upon which you can run the statements through your query analyzer to determine proper indexes, etc.

bcolflesh

3:35 pm on Nov 27, 2007 (gmt 0)