当前位置:网站首页>MySQL blocking monitoring script
MySQL blocking monitoring script
2022-07-28 02:33:00 【Oriental phantom】
#!/bin/sh
while :
do
mysql -uroot -p'12wsxCDE#' -e "select now();show full processlist\g;select b.trx_mysql_thread_id AS ' Blocked thread ',b.trx_query AS ' Blocked SQL',c.trx_mysql_thread_id AS ' Blocking threads ',(UNIX_TIMESTAMP()-UNIX_TIMESTAMP(c.trx_started)) AS ' Blocking time '
from information_schema.INNODB_LOCK_WAITS a
join information_schema.INNODB_TRX b on a.requesting_trx_id =b.trx_id
join information_schema.INNODB_TRX c on a.blocking_trx_id=c.trx_id
where (UNIX_TIMESTAMP()-UNIX_TIMESTAMP(c.trx_started))>60;"
ps aux --sort=-%cpu | head -20
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
sleep 15;
done
边栏推荐
- LETV responded that employees live an immortal life without internal problems and bosses; Apple refuses to store user icloud data in Russia; Dapr 1.8.0 release | geek headlines
- 智能合约安全——selfdestruct攻击
- MySQL explain (glory Collection Edition)
- Compile and use Qwt in qt|vs2017
- 实际工作中,我是如何使用 Postman 做接口测试?
- Promise from introduction to mastery (Chapter 2 understanding and use of promise)
- With elephant & nbsp; Eplato created by swap, analysis of the high premium behind it
- 【HCIP】BGP 基础
- 了解加密行业的“下一个大趋势”——Ventures DAO
- Skywalking distributed system application performance monitoring tool - medium
猜你喜欢

MySQL 中的 INSERT 是怎么加锁的?(荣耀典藏版)

Use try-with-resources or close this

小程序毕设作品之微信校园浴室预约小程序毕业设计成品(2)小程序功能

Wechat campus bathroom reservation applet graduation design finished product (2) applet function

What problems should be avoided when using BigDecimal type? (glory Collection Edition)

重要安排-DX12引擎开发课程后续直播将在B站进行

智能合约安全——selfdestruct攻击

ps 简单使用

Ceresdao: the world's first decentralized digital asset management protocol based on Dao enabled Web3.0

Compile and use Qwt in qt|vs2017
随机推荐
Canvas 从入门到劝朋友放弃(图解版)
Two ways for wechat applet to realize dynamic horizontal step bar
Feign calls get and post records
一文读懂Plato Farm的ePLATO,以及其高溢价缘由
Network must know topics
Find - block search
作业7.27 IO进程
Three core issues of concurrent programming (glory Collection Edition)
mysql: error while loading shared libraries: libtinfo.so. 5 solutions
了解加密行业的“下一个大趋势”——Ventures DAO
这个操作可能不值钱,但却值得学习 | 【图片批量裁剪】
Common SQL statement query
探究flex-basis
LeetCode 热题 HOT 100 -> 1.两数之和
Use try-with-resources or close this
[Star Project] small hat aircraft War (VI)
0动态规划中等 LeetCode873. 最长的斐波那契子序列的长度
MYSQL解决死锁之路 - 常见 SQL 语句的加锁分析
小程序毕设作品之微信校园浴室预约小程序毕业设计成品(3)后台功能
LeetCode 热题 HOT 100 -> 3. 无重复字符的最长子串