Does PHP's xdebug and qcachegrind record/report on time spent waiting for a database?

StackOverflow https://stackoverflow.com/questions/22662513

  •  21-06-2023
  •  | 
  •  

문제

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?

도움이 되었습니까?

해결책

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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top