189 8069 5689

percona-toolkit杀死慢的SQL语句-创新互联

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

创新互联建站长期为上千余家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为白城企业提供专业的成都网站制作、网站设计、外贸网站建设白城网站改版等技术服务。拥有10余年丰富建站经验和众多成功案例,为您定制开发。

# 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

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


名称栏目:percona-toolkit杀死慢的SQL语句-创新互联
当前URL:http://jkwzsj.com/article/cechdi.html

其他资讯