percona-toolkit 杀死慢的SQL语句
admin
2023-06-04 04:01:10
0

1、下载percona-toolkit-2.2.16.tar.gz

# wget

https://www.percona.com/downloads/percona-toolkit/2.2.16/tarball/percona-toolkit-2.2.16.tar.gz


2、安装

# ll

-rw-r--r-- 1 root root 1408239 11月  9 2015 percona-toolkit-2.2.16.tar.gz

# tar xf percona-toolkit-2.2.16.tar.gz

# cd percona-toolkit-2.2.16

# perl Makefile.PL


# yum -y install perl

# yum -y install perl-ExtUtils-MakeMaker.x86_64

# yum -y install perl-DBI.x86_64

# yum -y install perl-DBD-MySQL.x86_64

# perl Makefile.PL

# make

# make install


# yum -y install perl-Time-HiRes.x86_64


# /usr/local/bin/pt-kill -S /tmp/mysql.sock -u root -p"123456" \

--match-info "^(select|SELECT|Select)" \

--busy-time 5 --victim all --interval 3 --kill-query --print \

--log /usr/local/src/kill.txt --daemonize


--socket=s         -S  Socket file to use for connection

--user=s           -u  User for login if not current user

--password=s       -p  Password to use when connecting

--match-info=s         Match only queries whose Info (query) matches this Perl regex

--busy-time=m          Match queries that have been running for longer than

                         this time.  Optional suffix s=seconds, m=minutes, h=

                         hours, d=days; if no suffix, s is used.


--interval=m           How often to check for queries to kill.  Optional

                         suffix s=seconds, m=minutes, h=hours, d=days; if no

                         suffix, s is used.

--victims=s            Which of the matching queries in each class will be

                         killed (default oldest)


Actions:


  --execute-command=s    Execute this command when a query matches

  --kill                 Kill the connection for matching queries

  --kill-query           Kill matching queries

  --print                Print a KILL statement for matching queries; does not

                         actually kill queries

--log=s                Print all output to this file when daemonized

--daemonize            Fork to the background and detach from the shell



相关内容

热门资讯

5岁女童被马缰绳拖行致死,仅“... 一个幼小生命被马缰绳绕颈拖行致死,令人痛心。据纵览新闻报道,5月12日傍晚,两匹受惊的马闯入贵阳市白...
回响∣AI的奇豫记 【编者按】由中共河南省委宣传部、河南广播电视台联合制作的理论宣传系列微视频《回响·第四季》正式上线!...
央媒看河南丨积极融入服务全国统... 5月21日晚上8点,河南省许昌市胖东来生活广场人来人往。“五一”假期,许昌、新乡两地胖东来商超接待顾...
航拍山西矿难:矿口停满救护车 5月22日19时29分,山西长治市沁源县山西通洲集团留神峪煤业有限公司井下发生瓦斯爆炸事故,造成重大...
视频丨神二十三乘组确定:朱杨柱... 今天(5月23日)上午,神舟二十三号载人飞行任务新闻发布会在酒泉卫星发射中心召开。
专家解读|强化伦理安全标准 引... 当前,人工智能技术加速演进,正从内容生成、智能交互向行业应用、公共服务、知识生产、社会治理等领域持续...
2026“创翼东城”创业大赛决... 来源:中国青年报 中国青年报客户端讯(中青报·中青网记者 李桂杰)第九届“创业北京”创业大赛东城区选...
原创 4... 相信很多人小时候都会有一个天真的疑问:如果我们不停地往地下挖,会不会直接穿透地球,到达另一端?可现实...
青岛互联网推广为什么总像“碰运... 现在很多青岛企业做互联网推广,像极了一种“赛博焦虑”。 老板天天问: “为什么没询盘?” 运营天天愁...
总书记引领强国之路|不断铸就中... 原标题:学习新语·总书记引领强国之路丨不断铸就中华文化新辉煌