Mysql cpu usage is high.

Source: Internet
Author: User

Mysql cpu usage is high.

Now the game has opened the Thai server, and found that the cpu usage of the Thai server is always much higher than that of traditional Chinese or Mainland, and each time it occupies more than 300%

Top-15:34:06 up 222 days, 2 users, load average: 0.75, 0.73, 0.66
Task: 215 total, 1 running, 214 sleeping, 0 stopped, 0 zombie
Cpu (s): 52.4% us, 8.5% sy, 0.0% ni, 37.8% id, 1.0% wa, 0.0% hi, 0.3% si, 0.0% st
Mem: 32862732 k total, 31396120 k used, 1466612 k free, 194100 k buffers
Swap: 12361720 k total, 36232 k used, 12325488 k free, 29657368 k cached


Pid user pr ni virt res shr s % CPU % mem time + COMMAND
5032 mysql 20 0 8960 m 370 m 4696 S 494.9 1.2 29146, 13 mysqld
386 root 20 0 0 0 S 1.7 0.0 4479: 15 jbd2/dm-0-8
9208 root 20 0 97084 4076 S 3012 1.7. 05 sshd
9210 root 20 0 96832 3920 S 2996 1.0. 03 sshd
58 root 20 0 0 0 S 0.3 0.0 938: 02.46 kblockd/0
59 root 20 0 0 0 S 0.3 0.0 826: 25.48 kblockd/1
9207 root 20 0 15172 1420 R 1008 0.3 0: 00. 02 top

However, my mysql runs normally. The most common method is to check the mysql configuration.


However, my configuration should be fine, so I will wait for mysql to see which of the following statements are the most load:


Show processlist;


Find the SQL statement with the heaviest load and find the statement with the largest load. I found that my table structure was a joint primary key, but no index was set, so I created an index and lowered it.

If there are other discoveries later, they will be updated to this Article in time.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.