If the site was visited more slowly, how do you deal with?

There are factors that can lead to what access their Web site slow?

  • 1, the server export bandwidth is not enough
  • Purchase of export bandwidth server itself is relatively small. Once concurrent large, it would result in the export of bandwidth allocated to each user is small, the access speed will naturally slow.
  • Resulting in inter-carrier network bandwidth reduction. For example, the company's Web site on the telecommunications network, the client side is the Great Wall Broadband or docking Unicom, which may also lead to bandwidth reduction.

 

  • 2, server load is too large, leading to respond, but to

You can start the analysis from two aspects:

  • Analysis of system load, uptime command or use the w command to view the system load. If the load is high, the top command to view CPU, MEM and other occupancy, either the CPU is busy or is not enough memory.
  • If both are normal, NIC flow analysis using the sar command again, the analysis is not under attack. Once the analysis of the causes of the problem and take corresponding measures to address, such as deciding whether to kill some process or prohibiting certain visits.

 

  • 3, database bottleneck

If the slow query more. Then we would have a developer or DBA to assist in optimizing SQL statements.
If the database in response to slow, consider a database cache may be added, such as Redis like. Then, you can set up MySQL master-slave, a MySQL server is responsible for writing, in charge of several other read from the database.

 

  • 4, web development code is not optimized well

For example, the SQL statement is not optimized, resulting in time-consuming database to read and write.

 

For website access slow, how to troubleshoot?

  • 1, we must first determine the problem the client or the server side. When receiving user feedback slow access, immediate access to their own side of the site to see if their side access fast, basically concluded that the client is the problem, you need to patiently explain to customers, help customers solve problems.

Do not look at the issue up on the service side. Must start from the source, step by step down.

 

  • 2, if the access is slow, you can use the browser debugging features, take a look at that piece of data is loaded consume too much time, image loading is slow, or slow to load some data.

 

  • 3, for server load. View server hardware (network, CPU, memory) of consumption. If you bought cloud host, such as Ali cloud, you can log Ali cloud platform provides monitoring all aspects, such as CPU, memory, bandwidth usage.

 

  • 4. If you find the hardware resource consumption is not high, then you need to check the logs, for example, look at the log MySQL slow queries, see if it is a slow query SQL statement, resulting in slower access to the website.

 

How to solve?

1, if the export bandwidth issues, so long application to increase the export bandwidth.
2, if slow query more, then they would have a developer or DBA to assist in optimizing SQL statements.
3, if the database in response to slow, consider a database cache may be added, such as Redis like. Then you can also set up MySQL master-slave, a MySQL server is responsible for writing, in charge of several other read from the database.
4, for the purchase of CDN services, load the user's access.
5, if the access is still relatively slow, it needs to be optimized slightly from the overall architecture. Do special characters special, multiple servers to provide the same service.
 

 

 

 

Published 18 original articles · won praise 0 · Views 2419

Guess you like

Origin blog.csdn.net/newxwj/article/details/104750296