Web performance analysis with Xhprof (PHP) extensions

Source: Internet
Author: User
Recently work a little busy, often overtime, and occasionally will be overnight. But eventually the top Twitter " Mixed Stream"The whole volume went live smoothly. However, from a performance point of view, there is still a lot of room for improvement.

The following is an analysis of Web performance using Xhprof.

To install the xhprof extension:

Official documents outweigh everything. Http://php.net/xhprof

Note: If you want to take advantage of xhprof drawing, you need to turn the system default disable function on.

1

;disable_functions = phpinfo,system,exec,shell_exec,passthru,proc_close,show_source

To deploy the XHPROF runtime environment:

With the above configuration, Xhprof will output a report file after you have run the project. However, the contents of this document are serialized arrays. Therefore, a web environment that can read the data file needs to be built.

Here is a code for the XHPROF environment: HTTP://PAN.BAIDU.COM/S/1BNLVMRL

After accessing the XHPROF environment, you will see the following reporting interface.

Xhprof file list (/xhprof_html/list.php)

Xhprof Report in icon form (/xhprof_html/index.php)

    • Function Name method names
    • Calls number of Calls
    • Incl. Wall time the function execution times (contains the time of the internal other function calls)
    • Excl. Wall time the function executes (does not contain the time of the internal other function calls)

Xhprof report in flowchart form (/xhprof_html/callgraph.php)

A few things to focus on:

    • The same method has been called multiple times (perhaps the result of unnecessary loops)
    • Whether the time spent falls on the external interface (which affects the number of requests per second tps–)
    • Whether there is too much memory consumption (which can affect computational efficiency)

Article Source: Hu Xu Personal blog = "Original" Web performance analysis with Xhprof (PHP) extensions

Reprint please specify the source, offenders must investigate!

The above describes the use of xhprof (PHP) extension for Web performance analysis, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

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