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 ...
随机推荐
- input标签的按钮效果
https://codepen.io/anon/pen/EOPMNy <div class="row"> <p>Click every input.< ...
- mysql_connect(): Headers and client library minor version mismatch.
查询当前Client 版本,结果如下: Client API version => 5.6.31Client API library version => 5.6.31Client API ...
- JMeter元件的作用域与执行顺序
元件的作用域 先来讨论一下元件有作用域.<JMeter基础元件介绍>一节中,我们介绍了8类可被执行的元件(测试计划与线程组不属于元件),这些元件中,取样器 是典型的不与其它元件发生交互作用 ...
- Junit参数化
数据驱动测试:测试代码要与测试数据分离 哎~~学习时发现一个问题,写完了测试文件,右击文件时没有run as ->junit test的选项,找了好半天,终于知道了原因,是方法前没有加stati ...
- 手写css按钮组
css: .lf{float:left} .btn{ width:60px; height:24px; color:#fff; border-radius:4px; cursor:pointer; b ...
- 【javascript】onload load ready的那些事
首先明确一下页面加载的步骤: 1.下载解析HTML文档结构 2.加载外部脚本文件与样式表文件 3.解析并执行脚本代码 4.构造HTML DOM模型 5 .加载图片等外部文件 6.页面加载完毕 接下来, ...
- 使用自动化恶意软件分析cuckoo分析exe程序
Cuckoo是一款监控函数调用,监控文件读写,监控注册表读写等的自动化恶意分析软件. 包括apk.exe.pdf等多种文件的分析,将任务提交给数据库,host从数据库中读取任务,将样本放入虚拟机中运行 ...
- 游戏场景下的DDoS风险分析及防护
欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 作者:腾讯游戏云资深架构师 vince 本篇文章主要是分享游戏业务面临的安全风险场景,以及基于这些场景的特点,我们应该如何做好对应的防护. ...
- maven <resources>标签
<build> <finalName>com_dubbo_config</finalName> <resources> <resource> ...
- POJ 1185 炮兵阵地 经典的 状态压缩dp
炮兵阵地 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 16619 Accepted: 6325 Description ...