Mysql Io 读取数据数值上百亿高,求解

2014-07-05 10:59:18 +08:00
 hellohacker
网站三天两头的变慢,找了很多原因,但是问题没能解决。网站变慢的时候,服务器变得很卡.

[show processlis] 命令 会打印出
+----------+------+-----------------+------+---------+------+--------------------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----------+------+-----------------+------+---------+------+--------------------+------------------+
| 19021447 | root | 127.0.0.1:28253 | o2o | Query | 17 | removing tmp table | DESC fanwe_youhui_log |
| 19025616 | root | 127.0.0.1:32578 | NULL | Query | 0 | NULL | show processlist |
+----------+------+-----------------+------+---------+------+--------------------+------------------+


分析慢查询日志 N多下面的数据:
# Time: 140621 14:10:15
# User@Host: root[root] @ [127.0.0.1]
# Query_time: 24.078125 Lock_time: 0.000000 Rows_sent: 11 Rows_examined: 11
SET timestamp=1403331015;
DESC fanwe_youhui_log;
# Time: 140621 14:11:51
# User@Host: root[root] @ [127.0.0.1]
# Query_time: 14.312500 Lock_time: 0.015625 Rows_sent: 11 Rows_examined: 11
SET timestamp=1403331111;
DESC fanwe_youhui_log;
# Time: 140621 14:12:06
# User@Host: root[root] @ [127.0.0.1]
# Query_time: 10.843750 Lock_time: 0.015625 Rows_sent: 11 Rows_examined: 11
SET timestamp=1403331126;
DESC fanwe_youhui_log;
# Time: 140621 14:13:14
# User@Host: root[root] @ [127.0.0.1]
# Query_time: 26.656250 Lock_time: 0.000000 Rows_sent: 11 Rows_examined: 11
SET timestamp=1403331194;
DESC fanwe_youhui_log;
# Time: 140621 14:14:32
# User@Host: root[root] @ [127.0.0.1]
# Query_time: 10.312500 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0
SET timestamp=1403331272;
select group_concat(focused_user_id) from fanwe_user_focus where focus_user_id = 33073 order by rand() limit 50;
# Time: 140621 14:15:10
# User@Host: root[root] @ [127.0.0.1]
# Query_time: 21.359375 Lock_time: 1.953125 Rows_sent: 11 Rows_examined: 11
SET timestamp=1403331310;
DESC fanwe_youhui_log;
# Time: 140621 14:16:28
# User@Host: root[root] @ [127.0.0.1]
# Query_time: 16.984375 Lock_time: 0.000000 Rows_sent: 11 Rows_examined: 11
SET timestamp=1403331388;
DESC fanwe_youhui_log;
===========================================
按道理说 DESC Table 命令应该是很快的命令,今天发现 Mylsq IO数据特别高,对这块我也不了解,想请大家分析下:

我打开任务管理器,然后查看进程,在I /O 读取 这一列 数值是 43,658,476,259 I/O 写入 数值是:75,652,817
3020 次点击
所在节点    程序员
6 条回复
fredcc
2014-07-05 11:43:04 +08:00
您磁盘还正常么
liprais
2014-07-05 12:27:02 +08:00
这是磁盘有问题了吧.....
wdlth
2014-07-05 13:17:07 +08:00
IO次数疯长可能磁盘坏了。
hellojinjie
2014-07-05 15:21:55 +08:00
你是不是建了超多的数据库?内存够吗,在做swap吗
hellohacker
2014-07-05 19:29:23 +08:00
@hellojinjie
没有 数据库也就是6、7个的样子
fredcc
2014-07-05 19:50:34 +08:00
@hellohacker 先看下磁盘健康状态,阵列状态

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/121052

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX