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



相关内容

热门资讯

“贴耳大吼、扇巴掌”?新生儿入... 近日,四川成都一新生儿入住月子会所仅4天,突发颅内出血被送进ICU一事引发关注。孩子的母亲周女士反映...
特朗普称将就上诉法院涉白宫宴会... △特朗普(资料图)当地时间8月7日,美国总统特朗普在社交平台“真实社交”发文称,将立即就联邦上诉法院...
高景太阳能申请背接触电池前板专... 国家知识产权局信息显示,四川高景太阳能科技有限公司申请一项名为“背接触电池前板、其制备方法及光伏电池...
宿迁市政府领导专题调研江苏省宿... 8月6日,宿迁市副市长陈伟赴江苏省宿迁环境监测中心,专题调研“人工智能+监测”工作开展情况。宿迁市生...
科技改变生活:普通人如何抓住A... 听着, 科技这个词给人的感觉那可是相当的高大上, 就好像它仅仅是属于实验室里头的科学家或者硅谷的那些...
鼓励领导干部带头休假之后又撤回... 近日,河南省委组织部、省人力资源社会保障厅、省商务厅、省文化和旅游厅、省政府国资委、省总工会近日联合...
耗资4亿美元,特朗普的白宫宴会... 据路透社8月7日报道,美国一家联邦上诉法院于本周五下达指令,要求特朗普政府停止在已拆除的白宫东翼旧址...
胡锡进:新西兰外长像只疯狗,竟... 新西兰这几年出了一个对华非常恶毒的外交部长,他叫温斯顿·彼得斯,81岁。他给中新关系带来了与前些年截...
霍尔木兹协议将近达成,美伊正在... 关于霍尔木兹局势有哪些最新消息?凤凰卫视驻伊朗记者李睿从德黑兰发回报道:伊朗与阿曼就霍尔木兹海峡的协...
“新婚前夜输光3000亿”,硅... 文|张雪莹美国加利福尼亚州滨海小镇卡梅尔,终年海雾缭绕的松林海岸间,藏着众多精品艺廊与隐世豪宅,向来...