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 ...
随机推荐
- Ad Click Prediction: a View from the Trenches (2013)论文阅读
文章链接: https://static.googleusercontent.com/media/research.google.com/zh-CN//pubs/archive/41159.pdf 补 ...
- 026-log4j配置文件模板
模板一: ### direct log messages to stdout ### log4j.appender.stdout=org.apache.log4j.ConsoleAppender lo ...
- mongodb3.4 远程连接认证失败
mongodb开启或者关闭授权功能时还是挺麻烦的,需要新建服务键入mongod --auth.为了方便,我这里是建了两个服务,用到哪个就切换至哪个服务. --需要授权 mongod --logpath ...
- unity收集log工具
参考 yusong:http://www.xuanyusong.com/archives/2477 凉鞋 :https://www.cnblogs.com/liangxiegame/p/Uni ...
- Java下的i++问题
在解决一道面试题目时遇到问题. public class Inc { public static void main(String args[]){ Inc inc = new Inc(); int ...
- Java入门系列-24-实现网络通信
互联网上那么多设备,java 是如何与其他设备通信的呢?这次的内容是网络通信的基础,有了它咱们才能上网页.玩游戏.视频聊天. Socket 客户端套接字 Socket 客户端套接字,用于连接互联网提供 ...
- [LNMP]——LNMP环境配置
LNMP=Linux+Nginx+Mysql+PHP Install Nginx //安装依赖包 # yum install openssl openssl-devel zlib-devel //安装 ...
- java并发编程(1)并发程序的取消于关闭
一.任务的取消于关闭 1.中断Thread 1.每个线程都有一个boolean类型的中断状态.true则是中断状态中 interrupt:发出中断请求:isInterrupt:返回中断状态:inter ...
- 标准webservice调用
现代定义的webservice一般都倾向于restfull风格的http请求,但工作中还是会遇到前辈们写的时代代码. 我们更倾向于封装代码来调用,而不是服务引用.请看: Service.asmx服务的 ...
- JavaScript使用Object.defineProperty方法实现双数据绑定
Object.defineProperty这个方法非常值得学习,很多mvc框架中的双向数据绑定就是通过它来实现的. 本着互联网分享精神,今天我就将我自己的见解分享给大家,希望能有所帮助. 开始使用 O ...