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 ...
随机推荐
- Helper Devise: could not find the `Warden::Proxy` instance on request environment
在使用devise这个gem时,编写控制器层的单元测试,你需要在你的rspec帮助文件 rails_helper.rb里添加下面这一样 RSpec.configure do |config| conf ...
- CSS3 pointer-events:none应用举例及扩展
一.pointer-events:none是? pointer-events是CSS3中又一冉冉的属性,其支持的值牛毛般多,不过大多都与SVG相关,我们可以不用理会.当下,对于偶们来讲,与SVG划开界 ...
- Java虚拟机知识 总结 记录
总结了自己这两天掌握的一些JVM相关的知识.方便自己复习. jvm全称是Java Virtual Machine(java虚拟机).它之所以被称之为是“虚拟”的,就是因为它仅仅是由一个规范来定义的抽象 ...
- Django的学习基础1
著名的MVC模式:所谓MVC就是把web应用分为模型(M),控制器(C),视图(V)三层:他们之间以一种插件似的,松耦合的方式连接在一起. Django的MTV模式本质上与MVC模式没有什么差别,也是 ...
- js定义一个处理字符串的函数
//定义一个处理字符串的方法 function StringBuffer(str){ var arr = []; str = str || ''; arr.push(str); //追加字符串 thi ...
- Fatal error: Call-time pass-by-reference has been removed in *****.php on line 18
问题描述:最近刚刚将php升级到5.4.13,但是打开一个页面的时候出现报错:Fatal error: Call-time pass-by-reference has been removed in ...
- 批量查找ip地址归属地脚本
#!/bin/bash ip_list=`cat $1` for i in $ip_listdocurl http://www.ip.cn/index.php?ip=$idoneexit 0
- Magento 2开发教程 - 如何添加新产品属性
添加产品属性是一种在Magento 1 和 Magento 2最受欢迎的业务. 属性是解决许多与产品相关的实际任务的有力方法. 这是一个相当广泛的话题,但在这个视频中,我们将讨论添加一个下拉类型属性到 ...
- [转]ubuntu 13.04 体验wine qq
1.首先安装最新版的wine1.52,没记错版本号应该是这个 sudo add-apt-repository ppa:ubuntu-wine/ppa sudo apt-get update sudo ...
- orderby与groupby同时使用
两个同时使用:要求排序其他字段 select c1,max(c2) as a from table group by c1 order by a; in查询按照排序结果: ,,,....)