pt-query-digest(percona toolkit)小解
pt-query-digest [OPTIONS] [FILES] [DSN]
pt-query-digest slow.log
pt-query-digest --processlist h=host1
tcpdump -s -x -nn -q -tttt -i any -c port > mysql.tcp.txt
pt-query-digest --type tcpdump mysql.tcp.txt
pt-query-digest --review h=host2 --no-report slow.log
# .9s user time, .4s system time, 41.68M rss, 193.36M vsz
# Current date: Mon Jun ::
# Hostname: mxqmongodb2
# Files: /home/mysql/db3306/log/slowlog_343306.log
# Overall: 6.72M total, unique, 16.12 QPS, .69x concurrency _________
# Time range: --13T14:: to --18T10::
# Attribute total min max avg % stddev median
# ============ ======= ======= ======= ======= ======= ======= =======
# Exec time 287519s 1us 20s 43ms 148ms 339ms 214us
# Lock time 151259s 20s 23ms 144us 319ms 47us
# Rows sent 5.40M 0.84 0.99 6.58 0.99
# Rows examine 388.33M .72k 60.59 5.75 388.16 0.99
# Query size 692.26M 108.02 202.40 69.96 80.10
# Profile
# Rank Query ID Response time Calls R/Call V/M Item
# ==== ================== ================= ======= ====== ===== =========
# 0x255C57D761A899A9 146053.6926 50.8% 1.9225 2.93 UPDATE warehouse
# 0x813031B8BBC3B329 94038.9621 32.7% 0.3874 0.23 COMMIT
# 0xA0352AA54FDD5DF2 10125.5055 3.5% 0.1334 0.43 UPDATE order_line
# 0xE5E8C12332AD11C5 5660.5113 2.0% 0.0745 0.83 SELECT district
# 0xBD195A4F9D50914F 3634.6219 1.3% 0.0048 1.01 SELECT stock
# 0xF078A9E73D7A8520 3431.3527 1.2% 0.0452 0.81 UPDATE district
# 0x9577D48F480A1260 2307.4342 0.8% 0.0459 1.25 SELECT customer
# 0xFFDA79BA14F0A223 2158.4731 0.8% 0.0284 0.54 SELECT customer warehouse
# 0x5E61FF668A8E8456 1838.4440 0.6% 0.0012 0.74 SELECT stock
# 0x10BEBFE721A275F6 1671.8274 0.6% 0.0022 0.52 INSERT order_line
# 0x8B2716B5B486F6AA 1658.5984 0.6% 0.0219 0.75 INSERT history
# 0xBF40A4C7016F2BAE 1504.7939 0.5% 0.0020 0.77 SELECT item
# 0x37AEB73B59EFC119 1470.5951 0.5% 0.5182 0.27 INSERT SELECT tpcc._stock_new tpcc.stock
# 0x26C4F579BF19956D 1030.4416 0.4% 0.5199 0.28 INSERT SELECT tpcc.__stock_new tpcc.stock
# 0xD80B7970DBF2419C 493.0831 0.2% 0.5207 0.28 INSERT SELECT tpcc.__stock_new tpcc.stock
# 0xDE7EA4E363CAD006 488.2134 0.2% 0.5177 0.25 INSERT SELECT tpcc.__stock_new tpcc.stock
# 0x985B012461683472 470.6418 0.2% 0.5189 0.25 INSERT SELECT tpcc.__stock_new tpcc.stock
# MISC 0xMISC 9482.0467 3.3% 0.0043 0.0 < ITEMS>
# Query : 1.14 QPS, .19x concurrency, ID 0x255C57D761A899A9 at byte
# This item is included in the report because it matches --limit.
# Scores: V/M = 2.93
# Time range: --13T14:: to --14T09::
# Attribute pct total min max avg % stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count
# Exec time 146054s 160us 20s 2s 7s 2s 1s
# Lock time 142872s 39us 20s 2s 7s 2s 992ms
# Rows sent
# Rows examine .19k
# Query size 4.05M 55.88 56.92 0.82 54.21
# String:
# Hosts 127.0.0.1
# Users root
# Query_time distribution
# 1us
# 10us
# 100us ######################
# 1ms ##
# 10ms ###
# 100ms ##################################
# 1s ################################################################
# 10s+ ##
# Tables
# SHOW TABLE STATUS LIKE 'warehouse'\G
# SHOW CREATE TABLE `warehouse`\G
UPDATE warehouse SET w_ytd = w_ytd + WHERE w_id = \G
# Converted for EXPLAIN
# EXPLAIN /*!50100 PARTITIONS*/
select w_ytd = w_ytd + from warehouse where w_id = \G
[root@mxqmongodb2 bin]# ./pt-query-digest /home/mysql/db3306/log/slowlog_343306.log >/home/sa/slowlog_343306.log
[root@mxqmongodb2 bin]# ./pt-query-digest --since=24h /home/mysql/db3306/log/slowlog_343306.log >/home/sa/slowlog_343306_24.log
[root@mxqmongodb2 bin]# ./pt-query-digest --user=root --password= --port= --review h=172.16.16.35,D=test,t=query_report /home/mysql/db3306/log/slowlog_343306.log
mysql> select * from query_report limit \G
*************************** . row ***************************
checksum:
fingerprint: insert into order_line (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) values(?+)
sample: INSERT INTO order_line (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (, , , , , , , 62.41910171508789, 'N3F5fAhga7U51tlXr8AEgZdi')
first_seen: -- ::
last_seen: -- ::
reviewed_by: NULL
reviewed_on: NULL
comments: NULL
row in set (0.00 sec)
[root@mxqmongodb2 log]# mysqlbinlog mysql-bin. >/home/sa/mysql-bin_000012.log
[root@mxqmongodb2 bin]# ./pt-query-digest --type=binlog /home/sa/mysql-bin_000012.log >/home/sa/mysql-bin_000012_report.log
[root@mxqmongodb2 tpcc-mysql]# ./tpcc_start -h127.0.0. -P3306 -d tpcc -u root -p123456 -w -c -r -l
[root@mxqmongodb2 log]# tcpdump -s -x -nn -q -tttt -i any -c port >/home/sa/mysql.tcp.txt
[root@mxqmongodb2 bin]# ./pt-query-digest --type=tcpdump /home/sa/mysql.tcp.txt >/home/sa/mysql.tcp_repot.txt
[root@mxqmongodb2 sa]# cat mysql.tcp_repot.txt # .2s user time, 50ms system time, 27.65M rss, 179.15M vsz
# Current date: Tue Jun ::
# Hostname: mxqmongodb2
# Files: /home/sa/mysql.tcp.txt
# Overall: total, unique, 9.76 QPS, .52x concurrency ______________
# Time range: -- ::19.850032 to ::35.731291
# Attribute total min max avg % stddev median
# ============ ======= ======= ======= ======= ======= ======= =======
# Exec time 72s 63us 2s 463ms 1s 352ms 393ms
# Rows affecte 0.16 0.99 1.18
# Query size 6.17 5.75 1.85 5.75
# Warning coun 0.01 0.08 # Profile
# Rank Query ID Response time Calls R/Call V/M Item
# ==== ================== ============= ===== ====== ===== =========
# 0x813031B8BBC3B329 69.9077 97.4% 0.4569 0.25 COMMIT
# MISC 0xMISC 1.8904 2.6% 0.9452 0.0 < ITEMS> # Query : 9.63 QPS, .40x concurrency, ID 0x813031B8BBC3B329 at byte
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.25
# Time range: -- ::19.850032 to ::35.731291
# Attribute pct total min max avg % stddev median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count
# Exec time 70s 63us 2s 457ms 1s 336ms 393ms
# Rows affecte 0.16 0.99 1.19
# Query size
# Warning coun 0.01 0.08
# String:
# Hosts 127.0.0.1
# Query_time distribution
# 1us
# 10us #
# 100us ####
# 1ms #
# 10ms #
# 100ms ################################################################
# 1s ##########
# 10s+
commit\G
pt-query-digest(percona toolkit)小解的更多相关文章
- Percona Toolkit mysql辅助利器
1 PT介绍 Percona Toolkit简称pt工具—PT-Tools,是Percona公司开发用于管理MySQL的工具,功能包括检查主从复制的数据一致性.检查重复索引.定位IO占用高的表文件.在 ...
- Percona Toolkit工具使用
Percona Toolkit简称pt工具-PT-Tools,是Percona公司开发用于管理MySQL的工具,功能包括检查主从复制的数据一致性.检查重复索引.定位IO占用高的表文件.在线DDL等 下 ...
- Percona Toolkit工具连接MySQL 8报错的解决方案
使用Percona Toolkit的工具连接MySQL 8.x数据库时,会遇到类似"failed: Plugin caching_sha2_password could not be loa ...
- Centos 安装Percona Toolkit工具集
1.下载 下载地址: https://www.percona.com/downloads/percona-toolkit/LATEST/ [root@bogon ~]# wget https:// ...
- RDS for MySQL 如何使用 Percona Toolkit
Percona Toolkit 包含多种用于 MySQL 数据库管理的工具. 下面介绍常用的 pt-online-schema-change 和 pt-archiver 搭配 RDS MySQL ...
- Percona Toolkit工具集介绍
部署mysql工具是一个非常重要的部分,所以工具的可靠性和很好的设计非常重要.percona toolkit是一个有30多个mysql工具的工具箱.兼容mysql,percona server,mar ...
- Want to archive tables? Use Percona Toolkit’s pt-archiver--转载
原文地址:https://www.percona.com/blog/2013/08/12/want-to-archive-tables-use-pt-archiver/ Percona Toolkit ...
- Percona Toolkit 使用
安装 percona-toolkit perl Makefile.PL make make test make install 默认安装到 /usr/local/bin 目录下 可能需要 DBI-1. ...
- 使用Percona Toolkit解决Mysql主从不同步问题【备忘】
由于各种原因,mysql主从架构经常会出现数据不一致的情况出现,大致归结为如下几类 1:备库写数据 2:执行non-deterministic query 3:回滚掺杂事务表和非事务表的事务 4:bi ...
随机推荐
- nodejs之socket.io 聊天实现
写在前面:最近很火的“996”话题,可谓是引起一片热议,马老师说:能够996应该是幸运的,996是对奋斗者的一种机遇(记得不是很清楚).996缺少的是自己的空闲时间了,当我是空闲的时候偶尔996挺好的 ...
- (转)虚拟路由器冗余协议【原理篇】VRRP详解
原文:http://blog.51cto.com/zhaoyuqiang/1166840 为什么要使用VRRP技术 我们知道,为了实现不同子网之间的设备通信,需要配置路由.目前常用的指定路由方法有两种 ...
- Fiddler使用三(Fiddler内置命令)
参考:http://blog.csdn.net/ohmygirl/article/details/17855031 一. Fiddler内置命令. 上一节使用Fiddler进行抓包分析中,介绍到,在w ...
- ztree树样式的设计
ztree的功能虽然很是强大,但是唯一有一点就是样式有点普通,所以如果我们需要修改样式,那么就只能进行样式重新覆盖了 样式代码,这些都是根据实际样式进行覆盖 /** * tree的选中样式 */ .c ...
- 《Crafting Rails 4 Applications》的笔记-第28页
进行邮件测试,你需要在dummy目录下的虚拟程序添加一个配置 In your config/enviroments/test.rb, by default you should have the li ...
- web项目 log4j2 指定配置文件路径
pom.xml需要额外引入的jar: <dependency> <groupId>org.apache.logging.log4j</groupId> <ar ...
- FLUSH TABLES WITH READ LOCK 和 LOCK TABLES 之种种
1.FLUSH TABLES WITH READ LOCK 这个命令是全局读锁定,执行了命令之后所有库所有表都被锁定只读.一般都是用在数据库联机备份,这个时候数据库的写操作将被阻塞,读操作顺利进行. ...
- PHP自然排序,非自然排序(未完成)
还要研究一下,暂时先添加个链接 参考:PHP数组的“自然”排序
- 常用vue请求交互数据方式
几种 vue的数据交互形式 var that=this get请求 that.$http.get("1.txt").then(function(result){ console.l ...
- (转)The remote certificate is invalid according to the validation procedure
If you get “The remote certificate is invalid according to the validation procedure” exception while ...