这是一个创建于 3830 天前的主题,其中的信息可能已经有所发展或是发生改变。
网站三天两头的变慢,找了很多原因,但是问题没能解决。网站变慢的时候,服务器变得很卡.
[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
6 条回复 • 2014-07-05 19:50:34 +08:00
|
|
1
fredcc 2014-07-05 11:43:04 +08:00
您磁盘还正常么
|
|
|
2
liprais 2014-07-05 12:27:02 +08:00
这是磁盘有问题了吧.....
|
|
|
3
wdlth 2014-07-05 13:17:07 +08:00
IO次数疯长可能磁盘坏了。
|
|
|
4
hellojinjie 2014-07-05 15:21:55 +08:00 via Android
你是不是建了超多的数据库?内存够吗,在做swap吗
|