–match-state
匹配当前连接的状态
Locked
login
copy to tmp table
Copying to tmp table
Copying to tmp table on disk
Creating tmp table
executing
Reading from net
Sending data
Sorting for order
Sorting result
Table lock
Updating
–match-info
使用正则表达式匹配符合的sql
–match-db –match-user –match-host
见名知意
常用用法
杀掉空闲链接
pt-kill –match-command Sleep –idle-time 5 –host –port –interval –print –kill –victims all
杀掉运行时间超过5s的链接
pt-kill –match-command Query –busy-time 5 –host –port –interval –print –kill –victims all
杀掉匹配某个规则的正在运行的sql
pt-kill –match-command Query –busy-time 5 –host –port –interval –print –kill –victims all –match-info
杀掉正在进行filesort的sql
pt-kill –match-command Query –match-state “Sorting result” busy-time 5 –host –port –interval –print –kill –victims all
杀掉正在Copying to tmp table的sql
pt-kill –match-command Query –match-state “Copying to tmp table” busy-time 5 –host –port –interval –print –kill –victims all










