Percona-toolkit Kill Slow SQL statements

Source: Internet
Author: User
Tags print print install perl percona

1. Download 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. Installation

# LL

-rw-r--r--1 root root 1408239 November 9 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 has 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 would 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



Percona-toolkit Kill Slow SQL statements

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.