当前位置:网站首页>PT kill of MySQL
PT kill of MySQL
2022-06-10 07:26:00 【wang0907】
Write it at the front
The role of database in business development is self-evident , And sometimes we get caught up in big things , Long time query, etc , Because these problems may lead to a significant decline in database processing capacity , This seriously affects the responsiveness of the application . Of course, we can use simple commands to deal with these problems , For example, use kill Kill the corresponding thread , But it's still more troublesome , At this point, we can consider using tools , and percona Of pt-kill It provides this ability , Let's take a look at how to use .
1: install
stay here Download source package , Then execute the following command to install :
tar xvzf Data-Dumper-2.154.tar.gz
cd Data-Dumper-2.121
perl Makefile.PL
make
make install
Possible errors and solutions :
error :Can’t locate ExtUtils/MakeMaker.pm in @INC
Solution :yum install perl-ExtUtils-MakeMaker
error :bash:gcc:command not found
Solution :yum install gcc
error :Can't locate Data/Dumper.pm in @INC
Solution :
wget http://www.cpan.org/modules/by-module/Data/Data-Dumper-2.154.tar.gz
chmod +x Data-Dumper-2.154.tar.gz
tar xvzf Data-Dumper-2.154.tar.gz
cd Data-Dumper-2.154
perl Makefile.PL
make
make install
2: Command Introduction
pt-kill The command is mainly divided into the following four parts , Refer to screenshot :

3: example
3.1: Kill execution time exceeded 20s The sentence of
The following simulation sql sentence :
SELECT SLEEP(50000);
show processlist see :

Carry out orders :
[[email protected] Data-Dumper-2.154]# pt-kill --host=192.168.10.119 --port=3366 --user=root --password=root --match-command="Query" --busy-time 30 --victims all --interval 10 --print --kill --log=/tmp/1.log
# 2022-06-06T13:55:47 KILL 45 (Query 475 sec) select sleep(50000)
Others can be tested by parameter configuration .
Written in the back
Refer to the list of articles :
Pt-kill How to use it | Meichuang operation and maintenance diary .
边栏推荐
- 26. difference between mouseenter and mouseover
- 29. solution for 300ms delay time of click event at mobile terminal
- Arena, a new proposal of the go language community, can optimize memory allocation
- 一举刷新 54 个中文 NLP 任务基准,ERNIE3.0加持下的EasyDL可能是市面上最好用的NLP开发平台...
- SQL makes a column empty
- Fastjson利用笔记
- autojs与冰狐智能辅助的优缺点
- 成功解决:ImportError: cannot import name ‘Imputer‘ from ‘sklearn.preprocessing
- How to use Navicat to create an associated primary foreign key for two tables
- WPF 数据绑定(三)
猜你喜欢

「动态规划」0/1背包问题

一举刷新 54 个中文 NLP 任务基准,ERNIE3.0加持下的EasyDL可能是市面上最好用的NLP开发平台...

You can have zongzi if you want, but you have to go through my authentication and authorization

RT thread design and Implementation: RT thread overview and architecture

How to modify photos of downloaded word resume templates

npm怎么安装与使用

【宽度优先搜索】LeetCode1091二进制矩阵中的最短路径

RT-Thread设计与实现:RT-Thread 概述和架构

小程序:通过getCurrentPages获取当前页面路由信息

How to install and use NPM
随机推荐
OpenCV学习(二)---树莓派上安装opencv
Transplantation method of MySQL UUID function in Dameng
【软件测试】多家大厂的软件测试面试常见问题合集(BAT、三大流量厂商、知名大厂)
How to get the small icon in the title on the website
RT thread design and Implementation: RT thread overview and architecture
YOLO-SLAM: A semantic SLAM system towards dynamic environment with geometric constraint
WPF 数据绑定(三)
Loj10131. "all in one" 4.4 example 2 "dark chain problem solving tree difference (edge difference)
后疫情时代,医疗行业如何做好数字化转型?
Capacitive isolation principle
618 big promotion is in progress, Cloud Computing supports e-commerce live broadcast
Custom annotations support spiel expressions (dynamic parameters)
自动薅羊毛技术方案总结
618 l'informatique en nuage stimule la diffusion en direct du commerce électronique
All in one 1258 Dynamic programming of digital pyramid problem solving
【C语言】C语言程序设计:动态通讯录
2. zk的工作机制
618大促火热进行中,云计算力挺电商直播
Dream notes 0610
Cython的使用