I’ve been a little busy at work recently, often working overtime and occasionally staying up all night. But in the end, the popular Weibo "Mixed Stream" was successfully launched in full. However, from a performance perspective, there is still a lot of room for improvement.
The following is about using xhprof to analyze WEB performance.
Install xhprof extension:
Official documentation is better than anything => http://php.net/xhprof
Note: If you want to use xhprof drawing, you need to turn on the system default disabled function.
1 |
|
Deploy xhprof Running environment:
After the above configuration, xhprof will output a report file after you run the project. However, the contents of this file are serialized arrays. Therefore, it is necessary to build a WEB environment that can read the data file.
Here is a code for the xhprof environment: http://pan.baidu.com/s/1bnLvmrl
After that, by accessing the xhprof environment, you will see the following report interface.
xhprof file list (/xhprof_html/list.php)
xhprof report in icon form (/xhprof_html/index.php)
Whether the time consuming falls on the external interface (will Affects TPS – number of requests per second)
Is there excessive memory consumption (will affect computing efficiency) Article source: Hu Xu’s personal blog => [Original] Use xhprof (PHP) extension for WEB performance analysis