Not the answer you need?
Register and ask your own question!

pt-kill seems to ignore options

dmurraydmurray Current User Role Novice
I'm not sure if I'm using it wrong, but right now I'm using pt-kill 3.2.0 with MariaDB 10.3.23 on Ubuntu and it seems to indiscriminately kill any running query. Here's what I'm using from the command line, the goal is to kill queries run by 'username' that have been running for at least 5 minutes:
/usr/bin/pt-kill --busy-time 300 --match-user username --kill --print --pid=/var/run/ptkill.pid --interval=5 --defaults-file=/root/.my.cnf --log=/var/log/ptkill.log
And here's an example of the output I'm getting:
# 2020-06-26T18:01:24 KILL 18754 (Sleep 0 sec) NULL
Am I missing something obvious or is pt-kill definitely not working as expected here?

Answers

  • Agustin GAgustin G Percona Percona Staff Role
    Hi,
    I think this is happening due to the match on
    --match-user username
    you are using. From the docs:
    pt-kill will kill all the queries matching ANY of the specified criteria (logical OR). For example, using:
    --busy-time 114 --match-command 'Query|Execute'
    will kill all queries having busy-time > 114 OR where the command is Query or Execute

    This is why you will get queries in Sleep for only one second to be killed, because they are matching the user. 

Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.