Issues using pt-kill to kill log queries

Posted on

Question :

I’m trying to get pt-kill to work to kill queries running longer than n.

The command as I’m running now is;

pt-kill --busy-time 15 --print -u root -p `cat mysqlpw` --victims all --log /var/log/pt-kill.log --match-all

The problem is that I’m seeing lots of queries under 15 seconds being logged;

# 2016-08-06T20:29:34 KILL 187563 (Sleep 1 sec) NULL
# 2016-08-06T20:29:34 KILL 204826 (Sleep 0 sec) NULL
# 2016-08-06T20:29:34 KILL 204819 (Execute 0 sec) SELECT <snip>

Obviously I have no intention of killing these queries, so i haven’t been able to actually use this in anger yet.

Am I missing something in the args? Maybe its an issue with Maria10.1? I’d love to be able to use this.


Answer :

Try this one:

pt-kill --busy-time 15 --print -u root -p password --match-command Query --victims all

Then add --kill-query if you think this one is what you intend to use.


Changed --match-all to --victims all

Leave a Reply

Your email address will not be published. Required fields are marked *