How can I solve php performance optimization? And php Performance Detection ideas?

Source: Internet
Author: User
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?

  1. Front-end optimization http://www.cnblogs.com/y0umer/archive/2012/02/17/2809467.html
  2. Server optimized http://www.cnblogs.com/y0umer/archive/2011/10/24/2809490.html

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.