Question

Using PHP 5.5 on Amazon GNU/Linux.

Xdebug is recording profile data from a PHP app running via apache worker MPM.

When I view profile data with qcachegrind (running on an OS X laptop), very little time is attributed to php::mysql_* functions.

I know that this application is spending a substantial percentage of its time running database queries.

Is Xdebug not recording time spent waiting for the database or I am maybe not using qcachegrind correctly to view time spent waiting within the total time spent running PHP built in functions?

Was it helpful?

Solution

For me, running mysql_query('SELECT SLEEP(5)') results in a ~5000ms self-cost for the php::mysql_query function, so yes - it should report time spent waiting for the database.

Keep in mind though, using the xdebug profiler adds a lot of overhead to running PHP, so the proportion of time reportedly spent waiting for the database may not be the same as when running without the profiler (because the profiling of PHP doesn't add any overhead to the database engine itself).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top