当前位置:网站首页>Slow SQL fetching and analysis of MySQL database
Slow SQL fetching and analysis of MySQL database
2022-07-06 04:08:00 【Spring breeze turns into autumn rain】
1、 modify mysql Configure slow startup sql Inquire about
Modify the configuration file /etc/my.cnf
slow_query_log=ON
slow_query_log_file=/usr/local/mysql/data/slow.log
long_query_time=5explain :long_query_time This time can be set as 1, Never let go of anything more than 1 Second query .
2、 Check the settings
show VARIABLES like '%slow_query_log%';
show VARIABLES like '%long_query_time%';


3、 Installation and installation pt_query_digest
wget percona.com/get/pt-query-digest
mv pt-query-digest /usr/bin/
chmod +x /usr/bin/pt-query-digest
Installation and Perl Related modules
yum -y install 'perl(Data::Dumper)'
yum -y install perl-Digest-MD5
yum -y install perl-DBI
yum -y install perl-DBD-MySQL
4、 Analysis of the slow sql Log files
# All
pt-query-digest slow.log > pt_slow_sql_report.log
# near 30 Days of
pt-query-digest --since=30d mysql.log > pt_slow_sql_report.rtf
The following is an example of analysis result interception , The analysis result document will give each slow sql Details of .
# 570.6s user time, 47s system time, 88.15M rss, 252.14M vsz
# Current date: Wed Jun 29 17:33:45 2022
# Hostname: izzm08qanynb5doqrznbeyz
# Files: mysql.log
# Overall: 722.25k total, 212 unique, 0.28 QPS, 2.88x concurrency ________
# Time range: 2022-05-30T17:25:05 to 2022-06-29T09:20:58
# Attribute total min max avg 95% stddev median
# ============ ======= ======= ======= ======= ======= ======= =======
# Exec time 7376702s 5s 122s 10s 24s 7s 7s
# Lock time 3079s 0 56s 4ms 204us 437ms 84us
# Rows sent 15.08M 0 32.56k 21.89 0.99 517.96 0.99
# Rows examine 3.11T 0 32.05M 4.52M 6.94M 2.51M 5.99M
# Query size 542.74M 27 5.86k 787.96 2.27k 907.02 299.03边栏推荐
- P7735-[noi2021] heavy and heavy edges [tree chain dissection, line segment tree]
- 2/12 didn't learn anything
- [adjustable delay network] development of FPGA based adjustable delay network system Verilog
- 潘多拉 IOT 开发板学习(HAL 库)—— 实验9 PWM输出实验(学习笔记)
- Yyds dry goods inventory hcie security Day11: preliminary study of firewall dual machine hot standby and vgmp concepts
- Solution to the problem that the root account of MySQL database cannot be logged in remotely
- 脚本生命周期
- Scalpel like analysis of JVM -- this article takes you to peek into the secrets of JVM
- Ybtoj coloring plan [tree chain dissection, segment tree, tarjan]
- 有条件地 [JsonIgnore]
猜你喜欢

C#(三十)之C#comboBox ListView treeView

AcWing 243. A simple integer problem 2 (tree array interval modification interval query)

DM8 backup set deletion
![[adjustable delay network] development of FPGA based adjustable delay network system Verilog](/img/82/7ff7f99f5164f91fab7713978cf720.png)
[adjustable delay network] development of FPGA based adjustable delay network system Verilog
![[PSO] Based on PSO particle swarm optimization, matlab simulation of the calculation of the lowest transportation cost of goods at material points, including transportation costs, agent conversion cos](/img/41/27ce3741ef29e87c0f3b954fdef87a.png)
[PSO] Based on PSO particle swarm optimization, matlab simulation of the calculation of the lowest transportation cost of goods at material points, including transportation costs, agent conversion cos

About some basic DP -- those things about coins (the basic introduction of DP)
![[Key shake elimination] development of key shake elimination module based on FPGA](/img/47/c3833c077ad89d4906e425ced945bb.png)
[Key shake elimination] development of key shake elimination module based on FPGA

Ks008 SSM based press release system

Maxay paper latex template description

记一次excel XXE漏洞
随机推荐
记一次excel XXE漏洞
Simple blog system
Cf603e pastoral oddities [CDQ divide and conquer, revocable and search set]
/usr/bin/gzip: 1: ELF: not found/usr/bin/gzip: 3: : not found/usr/bin/gzip: 4: Syntax error:
Pandora IOT development board learning (HAL Library) - Experiment 9 PWM output experiment (learning notes)
Global and Chinese markets for endoscopic drying storage cabinets 2022-2028: Research Report on technology, participants, trends, market size and share
Basic use of MySQL (it is recommended to read and recite the content)
About some basic DP -- those things about coins (the basic introduction of DP)
C#(三十)之C#comboBox ListView treeView
P3033 [usaco11nov]cow steelchase g (similar to minimum path coverage)
Stc8h development (XII): I2C drive AT24C08, at24c32 series EEPROM storage
The Research Report "2022 RPA supplier strength matrix analysis of China's banking industry" was officially launched
DM8 backup set deletion
Web components series (VII) -- life cycle of custom components
[disassembly] a visual air fryer. By the way, analyze the internal circuit
【可调延时网络】基于FPGA的可调延时网络系统verilog开发
MySQL about self growth
Do you know cookies, sessions, tokens?
《2022年中国银行业RPA供应商实力矩阵分析》研究报告正式启动
How to standardize the deployment of automated testing?