Using xhprof.com to analyze PHP performance

Source: Internet
Author: User

Today, I stumbled across Www.xhprof.com's ability to analyze PHP code remotely, with the following general steps

1. Enter www.xhprof.com, click on the upper right corner to register and login, the left side of the site explains how to install the test xhprof, I use the right chart mode, so that can save the local build steps.

2. Install the xhprof extension locally, this is the same as the normal extension

  wget http://pecl.php.net/get/xhprof-0.9.3.tgz  tar zxvf xhprof-0.9.2.  tgz  cd xhprof-0.9.2/extension/  sudo phpize  ./configure--with-php-config=/usr/local/php /bin/php-config  sudo make  sudo make install  or yum install PHP-xhprof

3. Download the embedded script provided by www.xhprof.com and include it in the page you want to test

wget ' http://www.xhprof.com/lib_xhprof_com.php?username=***&&password=**************** '-o/tmp/lib_ xhprof_com.php contains include_once('/tmp/lib_from_xhprof_com.php ') at the beginning of the test page; # if it's on the line, it's better to add probability if (Mt_rand(1, +) = = 1)    {include_once('/tmp/lib_from_xhprof_com.php ');}

4. Click to access the chart mode http://www.xhprof.com/charts.php to see the performance information of your website.

5. It is convenient to sort performance information, filter URLs, etc.

6. You can save the performance information that you feel is characteristic (the website only stores 300 of the performance information without selecting save, redundant automatic cleanup), and of course it can delete the performance information.

Using xhprof.com to analyze PHP performance

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.