1

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.

Thanks.

2

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.

Edit

Changed --match-all to --victims all

  • Hi @jerichorivera, I tried Query, Execute and Sleep. I also tried match-all. It keeps including queries that are 0 seconds long. – Christian Aug 8 '16 at 1:33
  • Can you show what queries you are running and which ones you want to have killed by pt-kill? – jerichorivera Aug 10 '16 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.