1、测试脚本
[root@mysql5 ~]# cat proce.sh
while true
do
mysql -uroot -pmysql -e 'show processlist \G'|grep State >> /root/mysql.log
sleep 1
done
2、tail -f
[root@mysql5 ~]# tail -f mysql.log
State:
State: starting
State:
State: starting
State:
State: starting
State:
State: starting
State:
State: starting
State:
State: starting
State:
State: starting
State:
State: starting
State:
State: starting
3、对mysql.log按行进行排序、去重、计数
[root@mysql5 ~]# sort mysql.log |uniq -c
24 State:
24 State: starting
4、根据state的信息,对数据库进行分析
相关文章
- 01-26关于Hystrix超时机制和线程状态的测试观察和个人理解
- 01-26UNIX环境编程学习笔记(21)——进程管理之获取进程终止状态的 wait 和 waitpid 函数
- 01-26利用 AttachThreadInput 改变其它进程的输入法状态
- 01-26进程状态
- 01-26My.Ioc 代码示例——使用观察者机制捕获注册项状态的变化
- 01-26PeopleSoft进程卡在“已排队”状态诊断和解决
- 01-26线程和进程、多线程、线程状态、线程调度
- 01-26Linux进程状态(ps stat)之R、S、D、T、Z、X 转:http://blog.csdn.net/huzia/article/details/18946491
- 01-26Python模拟进程状态
- 01-26python模拟进程状态