This article is about the high concurrency of the PHP website how to optimize, has a certain reference value, now share to everyone, the need for friends can refer to the high concurrency solution case:
When the QPS reaches 2000,
Optimization scenario: Doing business separation, distributed storage
1. Flow optimization
Anti-theft chain processing (removal of malicious requests), current limit, speed limit, limiting concurrency
2. Front-End optimization
(1) Reduce HTTP requests [merge CSS,JS, etc.]
(2) Add an asynchronous request (do not show all the data to the user first, the user triggers an event before the data is requested asynchronously)
(3) Enable browser cache and file compression
(4) CDN Acceleration
(5) Create a standalone image server (reduce I/O)
3. Service-Side optimization
(1) static page
(2) Concurrent processing
(3) Queue processing
4. Database optimization
(1) Database Cache
(2) Sub-database sub-table, partition
(3) Read/write separation
(4) Load balancing
5.web Server Optimization
(1) Nginx reverse proxy for load balancing
(2) LVs for load Balancing
Related recommendations:
How to deal with large traffic and high concurrency problems in PHP Web site