最近遇到了MySQL性能问题,使用percona 的 pt-query-digest工具分析性能的瓶颈点。并且pt-query-digest工具要优于MySQL本身自带的mysqldumpslow工具。
查看pt-query-digest工具在ubuntu下的安装流程请看:ubuntu下安装pt-query-digest_一缕阳光a的博客-优快云博客https://blog.youkuaiyun.com/zgaoq/article/details/124710484?spm=1001.2014.3001.5502
先将结果贴上,然后在分析:
[root@xxx log]# pt-query-digest mysql-slow.log
# 110ms user time, 20ms system time, 37.57M rss, 49.25M vsz
# Current date: Wed May 11 15:49:08 2022
# Hostname: aaaa
# Files: /home/ddd/slow_query/slow3306_small.log
# Overall: 10 total, 7 unique, 0.00 QPS, 0.02x concurrency _______________
# Time range: 2022-04-27T15:39:28 to 2022-04-28T14:55:06
# Attribute total min max avg 95% stddev median
# ============ ======= ======= ======= ======= ======= ======= =======
# Exec time 1648s 500ms 827s 165s 271s 235s 29s
# Lock time 6ms 0 1ms 629us 925us 343us 626us
# Rows sent 1 0 1 0.10 0 0.30 0
# Rows examine 25.35M 1.48k 4.81M 2.53M 4.70M 2.21M 4.70M
# Rows affecte 1.43M 0 488.28k 146.48k 485.50k 222.49k 0
# Bytes sent 4.64G 0 1.08G 475.62M 1.08G 506.28M 106.64M
# Query size 864 13 543 78.55 11