Skip to content

Instantly share code, notes, and snippets.

Last active Jun 28, 2019
What would you like to do?
pt-kill example

pt-kill user must have SUPER PROCESS permission.

The following command intends to kill queries which have execute time greater than 30s and save terminated queries to database.

pt-kill --host=localhost --user=pt_kill_user --password=pt_kill_pass \
--busy-time=30 --interval=5s \
--log-dsn=h=localhost,D=pt_kill,t=kill_log,P=3306,u=root,p=root \
--kill --daemonize --ignore-user=backup


pt-kill --busy-time 30 --kill --daemonize \
--user pt_kill_user --ask-pass --print \
--log-dsn "D=ws_mail,t=kill_log,h=" \
--ignore-user "(backup|root)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment