Focus on cloud service provider activities
Notes on website operation and maintenance

Detection of MySQL overload and solutions (explain SSH TOP commands in detail)

When we use the host or VPS, MYSQL may occupy too much resources for some reasons, which may cause our host to be suspended. What are the reasons for the high load of MYSQL utilization? Sudden increase of a large number of concurrent tasks, due to the occupation of the website program script we use, man-made DDOS attacks and other reasons.

As a VPS user, we need to check whether the above MYSQL load is too heavy due to our own problems. Log in to SSH and enter the "top" command.

 top

Let's take a look at this line first. Because the VPS host used by Lao Zuo to write the tutorial is not used as a website, the data used is small. At present, only one WP blog is installed in this VPS.

Cpu(s): 0.2%us, 0.0%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.2%st

US: represents the percentage of CPU occupied in our space; SY: represents the percentage of CPU occupied in the kernel space; ID: represents the percentage of idle CPU; WA: represents the percentage of CPU utilization waiting for input.

The following two lines of MEM and SWAP represent the utilization of physical memory and swap memory. The first field represents the total amount, followed by the used and remaining.

Next, we will see the amount of CPU used by various processes. Because there is no content in my VPS at present, all I see is ROOT occupation. If there is site data running, there should be other processes, such as MySQL, Apache, etc.

For the problems that occur, we will deal with those that occupy too much space.

Vote for you
Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Detect MySQL overload and solutions (explain SSH TOP commands in detail)