Home >Backend Development >PHP Tutorial >How to optimize php website when there is high concurrency

How to optimize php website when there is high concurrency

不言
不言Original
2018-04-21 09:33:181855browse

The content of this article is about how to optimize the PHP website when it has high concurrency. It has a certain reference value. Now I share it with you. Friends in need can refer to the high concurrency solution case:

When When QPS reaches 2000
Optimization plan: Business separation, distributed storage

1. Traffic optimization

Anti-hotlink processing (removing malicious requests), current limiting, speed limiting , Limit the number of concurrencies


2. Front-end optimization
(1) Reduce HTTP requests [merge css, js, etc.]
(2) Add asynchronous requests (do not merge all data first) Displayed to the user, the user triggers an event before requesting data asynchronously)
(3) Enable browser caching and file compression
(4) CDN acceleration
(5) Establish an independent image server (reduce I/O)


3. Server-side optimization

(1) Page staticization
(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 to achieve load balancing
(2) lvs to achieve load balancing
Related recommendations:

PHP website How to deal with large traffic and high concurrency issues

The above is the detailed content of How to optimize php website when there is high concurrency. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn