PHP Performance analysis tool xhprof installation use tutorial

Source: Internet
Author: User

Hprof is an open source PHP lightweight performance analysis tool for Facebook, similar to Xdebug, but with lower performance overhead, can also be used in production environments or controlled by program switches. Based on Browse

The Performance analysis user interface of the device is easier to view or share results with peers. The call graph can also be drawn. During the data collection phase, it records the number of calls to trace and the inclusive indicator arcs in a dynamic CallGraph program.

It is unique to the reporting/post-processing phase of the data calculation. At data collection, XHPROFD handles recursive function calls by detecting loops and avoids the dead loop by invoking a useful name for each depth in the recursive call.

Xhprof's lightweight nature and aggregation capabilities make it ideal for collecting statistics on performance statistics for "production environments".

1. Installing Xhprof

wget http://pecl.php.net/get/xhprof-0.9.2.tgztar zxf xhprof-0.9.2.tgzcd xhprof-0.9.2cp-r xhprof_html Xhprof_lib < DIRECTORY_FOR_HTDOCS>CD Extensionphpize./configuremakemake Install

2. Configuring the php.ini File

[Xhprof]extension=xhprof.so;; Directory used by default implementation of the Ixhprofruns; Interface (namely, the Xhprofruns_default Class) for storing; Xhprof runs.; Remember <directory_for_storing_xhprof_runs>web to have write permission Xhprof.output_dir=<directory_for_storing_xhprof_runs >

Restart the service for the changes to take effect, you can now use Xhprof, but in order to show more dazzling, it is best to continue to install Graphviz.

3. Installing Graphviz

wget http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.26.3.tar.gz tar zxf graphviz-2.26.3.tar.gz CD graphviz-2.26.3./configuremake make Install

After the installation is complete, the/usr/local/bin/dot file is generated and you should make sure that the path is in the PATH environment variable so that xhprof can find it.
4. Apply Xhprof

PHP Performance analysis tool xhprof installation use tutorial

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.