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 ...
随机推荐
- Python学习 day14
一.生成器函数进阶 1.最后一个yield后的代码 先看示例: def generator(): print(123) yield 'a' print(456) yield 'b' print(789 ...
- 一个数字键盘引发的血案——移动端H5输入框、光标、数字键盘全假套件实现
https://juejin.im/post/5a44c5eef265da432d2868f6 为啥要写假键盘? 还是输入框.光标全假的假键盘? 手机自带的不用非得写个假的,吃饱没事干吧? 装逼?炫技 ...
- js函数声明提升与变量提升
变量提升 变量提升: 在指定作用域里,从代码顺序上看是变量先使用后声明,但运行时变量的 “可访问性” 提升到当前作用域的顶部,其值为 undefined ,没有 “可用性”. alert(a); // ...
- light table 添加行号 更新
在上一个笔记修改完字体后.再添加上行号
- 判断字符串中是否包含Emoji表情代码
判断字符串中是否包含Emoji表情代码: + (BOOL)stringContainsEmoji:(NSString *)string { __block BOOL returnValue = NO; ...
- Java入门系列-13-String 和 StringBuffer
这篇文章带你学会字符串的日常操作 String类 字符串在日常生活中无处不在,所以掌握字符串的使用至关重要. 使用 String 对象存储字符串,String 类位于 java.lang 包中,jav ...
- android studio应用修改到android源码中作为内置应用
1. 方法一:导入,编译(太麻烦,各种不兼容问题) android studio和eclipse的应用结构目录是不同的,但是在android源码中的应用基本上都是使用的eclipse目录结构(在/pa ...
- PostgreSQL PARTITION 分区表
PostgreSQL 分区表,操作性相当便捷. 但只能在创建时决定是否为分区表,并决定分区条件字段,普通表创建后,不能在修改为分区表. Note:通过其他方法也可转化为分区表. 和其他数据库一样,分区 ...
- AngularJS的基础知识
一.AngularJS指令与表达式 [AngularJS常用指令]1.ng-app:声明Angular所管辖的区域,一般写在body或HTML上,原则上一个页面只有一个.2.ng-model:把元素值 ...
- UML关系
UML关系详解 1.关联关系(association) 连接模型元素及链接实例,用一条实线来表示 2.依赖关系(dependency) 表示一个元素以某种方式依赖于另一个元素,用一条虚线加箭头来表示 ...