免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1191 | 回复: 0
打印 上一主题 下一主题

慢查询分析工具--mysqlsla [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-22 08:53 |只看该作者 |倒序浏览
  1. 安装
  2. # wget http://hackmysql.com/scripts/mysqlsla-2.03.tar.gz
  3. # tar zxvf mysqlsla-2.03.tar.gz
  4. # cd mysqlsla-2.03
  5. # perl Makefile.PL
  6. # make
  7. # make install

测试

[root@ldc2095 mysqlsla-2.03]# mysqlsla /var/lib/mysql/ldc2095-slow.log
Auto-detected logs as slow logs
Report for slow logs: /var/lib/mysql/ldc2095-slow.log
6.03k queries total, 238 unique
Sorted by 't_sum'
Grand Totals: Time 944.15k s, Lock 731 s, Rows sent 129.99M, Rows Examined 1.14G
 
 
______________________________________________________________________ 001 ___
Count         : 260  (4.31%)
Time          : 684598.79344 s total, 2633.072282 s avg, 2.767179 s to 6081.362266 s max  (72.51%)
  95% of Time : 605719.49628 s total, 2452.305653 s avg, 2.767179 s to 6045.503342 s max
Lock Time (s) : 211.046 ms total, 812 µs avg, 193 µs to 52.139 ms max  (0.03%)
  95% of Lock : 105.618 ms total, 428 µs avg, 193 µs to 1.866 ms max
Rows sent     : 1.18k avg, 236 to 1.20k max  (0.24%)
Rows examined : 790.89k avg, 4.06k to 810.41k max  (18.10%)
Database      :
Users         :
        dev@ 172.16.215.75 : 100.00% (260) of query, 98.57% (5944) of all users
 
Query abstract:
SET timestamp=N; SELECT /* smw::getqueryresult N.N.N.N */ DISTINCT t0.smw_id AS id,t0.smw_title AS t,t0.smw_namespace AS ns,t0.smw_iw AS iw,t0.smw_sortkey AS sortkey,t0.smw_sortkey FROM smw_ids AS t0 INNER JOIN smw_ids AS t1 ON t0.smw_id=t1.smw_id WHERE t1.smw_namespace='S' ORDER BY t0.smw_sortkey ASC LIMIT N;
 
Query sample:
SET timestamp=1309528970;
SELECT /* SMW::getQueryResult 66.249.71.8 */  DISTINCT t0.smw_id AS id,t0.smw_title AS t,t0.smw_namespace AS ns,t0.smw_iw AS iw,t0.smw_sortkey AS sortkey,t0.smw_sortkey  FROM `smw_ids` AS t0 INNER JOIN `smw_ids` AS t1 ON t0.smw_id=t1.smw_id  WHERE t1.smw_namespace='1180'  ORDER BY t0.smw_sortkey ASC  LIMIT 1201;
 
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP