Processing and Solution of High Concurrent and High Traffic Access to Websites

 Watson Blog December 6, 2017 13:06:50 The server comment two hundred and fifty-eight Reading mode

This is another question often asked in php interviews. For a new blogger, I really don't know these methods. I copied a copy on the Internet for easy viewing.

1. Hardware upgrade

Ordinary P4 servers can generally support up to 100000 independent IP addresses per day. If the number of accesses is larger than this, you must first configure a dedicated server with higher performance to solve the problem. Otherwise, no optimization can completely solve the performance problem.

2. Load balancing

It distributes the request to each server in the cluster according to a certain load strategy, so that the entire server cluster can handle the request of the website.
If the company is rich, it can purchase hardware (such as F5) that is specifically responsible for load balancing, and the effect will be very good. For most companies, they will choose cheap and effective methods to expand the architecture of the whole system to increase the throughput, processing capacity and bearing capacity of the server.

3. Server cluster

Server cluster refers to gathering N servers together for the same service, and they communicate with each other through the network. Let N servers cooperate with each other to jointly carry the request pressure of a website.
It seems to the client that there is only one server. The cluster can use multiple computers for parallel computing to achieve high computing speed, and can also use multiple computers for backup, so that the whole system can still run normally if any machine breaks down.

4. Database read/write separation

The basic principle is to let the main database handle transactional add, change, and delete operations (INSERT UPDATE、DELETE), The SELECT query operation is processed from the database.

5. Database table splitting technology (vertical segmentation, horizontal segmentation)

When a piece of data reaches several million, it will take more time to query once. If there is a federated query, it is likely to die there. The purpose of table splitting is to reduce the burden of the database and shorten the query time.

6. Create corresponding indexes for tables

Use indexes to quickly access specific information in database tables.

7. Page static

It is best to realize complete statics on the front end, which can completely avoid accessing the database.

8. Cache technology (MemCache, Redis)

Caching technology is another solution, which is to store dynamic data in cache files, and dynamic web pages can directly call these files without accessing the database

9. No external piracy

Piracy of images or files on external websites often brings a lot of load pressure, so external image or file piracy should be strictly limited

10. Control the download of large files

Downloading large files takes up a lot of traffic, and for non SCSI hard disks, a large number of file downloads will consume CPU, reducing the website's responsiveness. Therefore, try not to provide a large file download of more than 2M. If you need to provide a large file, it is recommended to put it on another server.

 Watson Blog
  • This article is written by Published on December 6, 2017 13:06:50
  • This article is collected and sorted by the website of Mutual Benefit, and the email address for problem feedback is: wosnnet@foxmail.com , please keep the link of this article for reprinting: https://wosn.net/897.html

Comment