Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1839210
  • 博文数量: 117
  • 博客积分: 2559
  • 博客等级: 少校
  • 技术积分: 4385
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-13 20:08
个人简介

作为初学者,要想取得进步,成为高手,首先应该了解自己的不足之处.

文章分类

全部博文(117)

文章存档

2014年(1)

2013年(25)

2012年(13)

2011年(77)

2010年(1)

分类: Mysql/postgreSQL

2014-08-27 22:19:01

如何每10秒检查一次,杀死指定用户超过100秒的查询?
pt-kill \
--no-version-check \
--host 127.0.0.1 --port 3306 --user 'xxxxxx' --password 'xxxxxx' \
--charset utf8 \
--match-command Query \
--match-user 指定的用户名 \
--busy-time 100 \
--kill \
--victims all \
--interval 10 \
--print
常用参数说明
  • no-version-check
    不最新检查版本
  • host
    连接数据库的地址
  • port
    连接数据库的端口
  • user
    连接数据库的用户名
  • passowrd
    连接数据库的密码
  • charset
    指定字符集
  • match-command
    指定杀死的查询类型
  • match-user
    指定杀死的用户名,即杀死该用户的查询
  • busy-time
    指定杀死超过多少秒的查询
  • kill
    执行kill命令
  • victims
    表示从匹配的结果中选择,类似SQL中的where部分,all是全部的查询
  • interal
    每隔多少秒检查一次
  • print
    把kill的查询打印出来
阅读(10707) | 评论(2) | 转发(1) |
0

上一篇:How to setup a slave for replication

下一篇:没有了

给主人留下些什么吧!~~

ning_lianjie2016-04-14 18:15:15

wang1352083:hi连杰: 
我在用 pt-kill时, 如果配置频率高,有自动退出的情况.
我的命令执行方式:
./pt-kill --defaults-file=~/conf/etc/user.root.cnf --busy-time=5 --match-db=surl --match-user=surl_w --print --kill --victims all --daemonize --interval 3
你遇到过这个case吗?

interval 配置过高吗? 我曾经配置过1秒, 没有发生自动退出的情况.

回复 | 举报

wang13520832016-03-01 13:10:36

hi连杰: 
我在用 pt-kill时, 如果配置频率高,有自动退出的情况.
我的命令执行方式:
./pt-kill --defaults-file=~/conf/etc/user.root.cnf --busy-time=5 --match-db=surl --match-user=surl_w --print --kill --victims all --daemonize --interval 3
你遇到过这个case吗?