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.