0

I can see high CPU usage when I hit search URL of my Drupal application. I have enabled XHProf module and UProfiler extension on PHP5.6 to find the culprit function.

But the report I am getting is giving me only the first level of functions which takes cpu time.

enter image description here

But, there is no hyperlink on the function names to click on it and drill down. Any suggestions on what else can be done to drill down?

Basically it shows only flat profile, how do I get Hierarchical profile view?

karthikeayan
  • 4,291
  • 7
  • 37
  • 75

2 Answers2

3

You should take a look at php-spx https://github.com/NoiseByNorthwest/php-spx

It's a (tracing/sampling) profiler shipped with its web UI to allow in-depth analysis of profiling report (interactive time line, flat profile, Flamegraph).

DISCLAIMER: I'm the author.

  • +1 Kudos for building a tool. Question: Can sampling occur during I/O or system calls? Opinions: I hope so. Also, accuracy is overrated, along with all the issues of sampling frequency. If there's a speed bug taking a big enough % of time to be worth fixing, it will show up in a moderate number of samples. – Mike Dunlavey Jun 19 '18 at 23:22
  • Sampling is done synchronously, roughly in the same way as Xhprof. And don't worry, any function call with execution time longer than the sampling period is guarenteed to have, at least, its end stack collected. So long blocking functions will be monitored, and even more accuratly (lower margin of error) than shorter functions. – NoiseByNorthwest Jun 20 '18 at 07:00
0

This is fully possible with the native GUI that comes with Xhprof, you just have to make the xhprof_html directory reachable from your document root.

Patrick Allaert
  • 1,751
  • 18
  • 44