How to install and use the PHP function-level hierarchical performance analysis tool xhprof

Source: Internet
Author: User
How to install and use the PHP function-level hierarchical performance analysis tool xhprof 1. download and install xhprof

$ wget http://pecl.php.net/get/xhprof-0.9.4.tgz$  tar zxvf xhprof-0.9.4.tgz$  cd xhprof-0.9.4/extension/$  phpize$  ./configure $  make$  sudo make install

2. configure php. ini

[xhprof]extension=xhprof.so;xhprof.output_dir=/tmp/xhprof

Restart php-fpm

$ service php-fpm restart

3. usage

 Save_run ($ data, "xhprof"); var_dump ($ run_id );

4. page display instructions

Copy the xhprof_lib & xhprof_html directory to the accessible address to access xxx/xhprof_html/index. php? Run = $ run_id & source = xhprof. you can see the running status of your php code. The following describes some parameters that indicate that the random Time includes all the execution Time of the sub-function. Exclusive Time/Self Time: the Time consumed by the function execution, excluding the Time consumed by the subtree. The Time that Wall Time took or the Time when the Wall clock was suspended. CPU Time user consumed Time + kernel consumed Time: CPU occupied by the CPU exclusive function itself, including the CPU occupied by the CPU used by the sub-function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.