|
First, what is XHProf
XHProf is a hierarchical PHP performance analysis tools. It reports the number of requests and function-level indicators, including the blocking time, CPU time and memory usage. The overhead of a function can be subdivided into the caller and callee overhead, XHProf data collection phase, which tracks and records the indicators arc inclusive of the number of calls in a program of dynamic callgraph. Reports its unique data computing / post-processing stage. When data collection, XHProfd by detecting loops to process recursive function calls, and by recursive calls to call each depth of a useful name to avoid an endless loop. XHProf analysis reports help to understand the structure of the code is executed, it has a simple HTML user interface (PHP written). Browser-based performance analysis user interface makes it easier to view, or share the results with colleagues. Also can draw the call graph.
Second, install expansion modules XHProf
1, the installation
wget http://pecl.php.net/get/xhprof-0.9.2.tgz
tar zxvf xhprof-0.9.2.tgz
cp ./xhprof-0.9.2.tgz./www // xhprof with its own version of a web page analysis, into my web server below
cd xhprof-0.9.2 / extension
/ Usr / local / php / bin / phpize
./configure --enable-xhprof --with-php-config = / usr / local / php / bin / php-config
make && make install
2, the configuration
[Xhprof]
extension = xhprof.so
xhprof.output_dir = / home / yicheng / xhprof // if not stored directory, the default is on the / tmp below
Three, XHProf test
Earlier we talked, XHProf with its own version of a web testing tools, there is also a small example. Look at this example, I did a little modification and comments
|
|