日期:2014-05-16  浏览次数:21153 次

江湖救急~~~mysql的cpu使用率百分之一千多!!
Tasks: 583 total, 4 running, 579 sleeping, 0 stopped, 0 zombie
Cpu(s): 35.3%us, 6.9%sy, 0.0%ni, 57.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 65976288k total, 50604344k used, 15371944k free, 7638260k buffers
Swap: 65537156k total, 360k used, 65536796k free, 38368636k cached

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
  620 mysql 15 0 3889m 1.3g 5820 S 1110.7 2.0 328:51.92 mysqld
10191 nobody 18 0 161m 18m 3972 R 68.9 0.0 0:02.10 httpd
 9701 nobody 17 0 160m 18m 4320 R 50.6 0.0 0:04.73 httpd
10254 nobody 17 0 162m 19m 4312 R 38.4 0.0 0:02.78 httpd
10239 nobody 18 0 163m 20m 4068 S 36.8 0.0 0:01.81 httpd
10255 nobody 17 0 161m 19m 4304 S 19.0 0.0 0:04.71 httpd
 9839 nobody 17 0 161m 19m 4324 S 10.5 0.0 0:04.66 httpd
 9826 nobody 20 0 161m 19m 4296 S 8.5 0.0 0:04.74 httpd
10182 nobody 15 0 154m 12m 4360 S 1.6 0.0 0:03.26 httpd

各位大哥救救小弟吧,这台服务器跑着apache和mysql服务,其中mysql的使用已经1110.7%,这是什么原因哪?

------解决方案--------------------
这个百分比是每个cpu跑的加起来的总和 比如你又16核 每个跑50% 则显示800%


你在top命令后q键上面的1 就可以看到了
------解决方案--------------------
查查MySQL都在干什么
SQL code
show processlist;

------解决方案--------------------
SQL code

mysql> show global variables like '%innodb_buffer_pool_size%';
+-------------------------+-----------+
| Variable_name           | Value     |
+-------------------------+-----------+
| innodb_buffer_pool_size | 319815680 |
+-------------------------+-----------+
1 row in set (0.00 sec)

mysql> show global variables like 'key_buffer_size%';
+-----------------+-----------+
| Variable_name   | Value     |
+-----------------+-----------+
| key_buffer_size | 164626432 |
+-----------------+-----------+
1 row in set (0.00 sec)