# 只打印-查杀select大于30s的会话
pt-kill --host=127.0.0.1 --port=3306 --user=root --password=rootpwd --match-db='machine' --match-info "select|SELECT" --busy-time 30 --victims all --interval 10 --daemonize --print --log=/tmp/pt_select.log
# 执行杀操作-查杀select大于30s的会话
pt-kill --host=127.0.0.1 --port=3306 --user=root --password=rootpwd --match-db='machine' --match-info "select|SELECT" --busy-time 30 --victims all --interval 10 --daemonize --kill --log=/tmp/pt_select_kill.log
# 只打印-查杀某IP来源的会话
pt-kill --host=127.0.0.1 --port=3306 --user=root --password=rootpwd --match-db='machine' --match-host "192.168.65.129" --busy-time 30 --victims all --interval 10 --daemonize --print --log=/tmp/pt_select.log
# 执行杀操作-查杀某IP来源的会话
pt-kill --host=127.0.0.1 --port=3306 --user=root --password=rootpwd --match-db='machine' --match-host "192.168.65.129" --busy-time 30 --victims all --interval 10 --daemonize --kill --log=/tmp/pt_select_kill.log
# 只打印-查杀指定用户的会话
pt-kill --host=127.0.0.1 --port=3306 --user=root --password=rootpwd --match-db='machine' --match-user "u2" --busy-time 30 --victims all --interval 10 --daemonize --print --log=/tmp/pt_select.log
# 执行杀操作-查杀指定用户的会话
pt-kill --host=127.0.0.1 --port=3306 --user=root --password=rootpwd --match-db='machine' --match-user "u2" --busy-time 30 --victims all --interval 10 --daemonize --kill --log=/tmp/pt_select_kill.log
# 只打印-杀掉正在进行filesort的sql
pt-kill --host=127.0.0.1 --port=3306 --user=root --password=rootpwd --match-db='machine' --match-command Query --match-state "Sorting result" --run-time 1 --busy-time 30 --victims all --interval 10 --daemonize --print --log=/tmp/pt_select.log
# 执行杀操作-杀掉正在进行filesort的sql
pt-kill --host=127.0.0.1 --port=3306 --user=root --password=rootpwd --match-db='machine' --match-command Query --match-state "Sorting result" --run-time 1 --busy-time 30 --victims all --interval 10 --daemonize --kill --log=/tmp/pt_select_kill.log
# 只打印
pt-kill --host=127.0.0.1 --port=3306 --user=root --password=rootpwd --match-db='machine' --match-command Query --match-state "Creating sort index" --run-time 1 --busy-time 30 --victims all --interval 10 --daemonize --print --log=/tmp/pt_select.log
# 执行杀操作
pt-kill --host=127.0.0.1 --port=3306 --user=root --password=rootpwd --match-db='machine' --match-command Query --match-state "Creating sort index" --run-time 1 --busy-time 30 --victims all --interval 10 --daemonize --kill --log=/tmp/pt_select_kill.log