A php project, or product, starts from nothing, from a few users to tens of thousands or even more users. In many cases, performance bottlenecks may occur, from rapid project development, not focusing on SQL statements, to SQL statement optimization; from no cache to adding cache, cache servers from one to more... a php project, or product, starts from nothing, from a few users to tens of thousands or even more users. In many cases, performance bottlenecks may occur, from rapid project development, not focusing on SQL statements, to SQL statement optimization, from no cache, to adding cache, from one to multiple cache servers.
At present, sometimes it may be a bit confused, although with the continuous optimization, the performance is gradually improved. However, the number of percentage points after optimization, how to detect, and how to record are all problems.
Thank you very much.
Reply content:
A php project, or product, starts from nothing, from a few users to tens of thousands or even more users. In many cases, performance bottlenecks may occur, from rapid project development, not focusing on SQL statements, to SQL statement optimization, from no cache, to adding cache, from one to multiple cache servers.
At present, sometimes it may be a bit confused, although with the continuous optimization, the performance is gradually improved. However, the number of percentage points after optimization, how to detect, and how to record are all problems.
Thank you very much.
Xhprof shows the time consumed in code execution.
It is also necessary to use the benchmark tool.
I/O is the main performance bottleneck.
You can use Xdebug to analyze the program running status and use FPM to enable slow_log.
Use xhprof to view the report and then optimize it one by one.
Can look at my write a few blog, PHP optimization recommendations, testing tools and so on, may be useful to you, http://www.chenglin.name/category/php/optimization
You can consider the encoding rules, variable/data caching, Opcode caching, and databases. You can refer to the high-performance PHP application development book, which describes the optimization, how to optimize, and some testing tools.
The performance limit of php is also optimized. php does not need to be optimized as long as there is no major logic problem (for example, getting a small item to loop through several hundred times, the focus is on SQL queries and cache servers.
The performance improvement mainly comes from three aspects:
1. User Experience
2. Logic
3. Data
If it is a "product", first put the user experience first, and second, optimization at the logic layer (educational programmers)
Third, Data Optimization
Of course, the above are all about technical optimization, such as xdebug, benchmark, and other testing tools for analysis ..
How can I change it to "Web performance optimization?
- Front-end optimization http://www.cnblogs.com/y0umer/archive/2012/02/17/2809467.html
- Server optimized http://www.cnblogs.com/y0umer/archive/2011/10/24/2809490.html