Using SHOW PROCESSLIST and mysqladmin debug Output in Conjunction with SHOW INNODB STATUS
When InnoDB appears hung, I know the natural reaction is to check SHOW ENGINE INNODB STATUS.
In fact, it’s the first thing I check when InnoDB tables are involved.
However, I just want to iterate how valuable SHOW FULL PROCESSLIST and/or mysqladmin debug outputs can be even when it seems mysqld is hung on on InnoDB table.
Two recent cases I’ve encountered illustrate why.
Case #1:
MySQL appeared hung on the following simple, single-row INSERT:
---TRANSACTION 0 2035648699, ACTIVE 76629 sec, process no 9047,
OS thread id 3069426592, thread declared inside InnoDB 500
mysql tables in use 1, locked 1
...
INSERT INTO test (id, parent, text) VALUES (180370, 70122, 'test table')
At least that’s what it seemed per the INNODB STATUS, but unfortunately, there wasn’t any further information to go on.
The next time it occurred, SHOW FULL PROCESSLIST was captured at the time.
Turns out, there was a *very* long SELECT running, but not from the same table, and no foreign keys (FKs) either. Turned out it was some crazy, auto-generated query that self-joined itself 548 times. So there were no locks, per se. This query itself held up everything, and thus also the INSERT.
Case #2:
This was a table that was also hanging on a certain, simple UPDATE. The UPDATE was based on te PK, so only one row was to be updated.
Yet, it hung, and it hung, longer than wait_timeout, interactive_timeout, and innodb_lock_wait_timeout. And there were no other transactions running in the INNODB STATUS.
Turned out, another client had issued a LOCK TABLE command on the table. Since LOCK TABLE is handled outside of the InnoDB storage engine, the lock doesn’t appear in SHOW INNODB STATUS output.
Using mysqladmin debug output, coupled with SHOW PROCESSLIST helped catch this offender.
At any rate, hope this helps, and happy troubleshooting.
参考:
http://www.chriscalender.com/using-show-processlist-and-mysqladmin-debug-output-in-conjunction-with-show-innodb-status/
Using SHOW PROCESSLIST and mysqladmin debug Output in Conjunction with SHOW INNODB STATUS的更多相关文章
- mysqladmin processlist; show processlist/status/open tables/engine/variables/table status/columns/grants/index/privileges/innodb status/logs/warnings/////; 结果筛选
mysqladmin showprocesslist可查看完整sql需要权限. SHOW PROCESSLIST显示哪些线程正在运行.您也可以使用mysqladmin processlist语句得到此 ...
- 使用 mysqladmin debug 查看死锁信息
使用 mysqladmin debug 查看死锁信息 mysqladmin -S /mysql/data/mysql.sock debug 然后在error日志中,会看到: 11 lock struc ...
- InnoDB Status Output – Buffer Pool and Spin Rounds
InnoDB has a good source of information about its status which can be requested every time you need ...
- 初步认知MySQL metadata lock(MDL)
http://blog.itpub.net/26515977/viewspace-1208250/ 概述 随着5.5.3引入MDL,更多的Query被“Waiting for table metada ...
- Metadata Lock原理3
http://blog.itpub.net/26515977/viewspace-1208250/ 腾讯工程师 随着5.5.3引入MDL,更多的Query被“Waiting for table ...
- adaptive hash index
An optimization for InnoDB tables that can speed up lookups using = and IN operators, by constructin ...
- Show Global Status 整理
原文来源:MySQL 5.5 Reference Manual 部分翻译取自:<MySQL_5.1中文参考手册> 转载请注明原文链接http://www.cnblogs.com/lenag ...
- MySQL的innoDB锁机制以及死锁处理
MySQL的nnoDB锁机制 InnoDB与MyISAM的最大不同有两点:一是支持事务(TRANSACTION):二是采用了行级锁.行级锁与表级锁本来就有许多不同之处,innodb正常的select ...
- MySql 自适应哈希索引
一.介绍 哈希(hash)是一种非常快的查找方法,一般情况下查找的时间复杂度为O(1).常用于连接(join)操作,如Oracle中的哈希连接(hash join). InnoDB存储引擎会监控对表上 ...
随机推荐
- 关于offer选择
6月1日收到移动调剂到昭通移动的电话,当时第一反应就是拒绝,后来参考了很久,犹豫了很久,答应了hr:答应了就有点后悔了:各种挑刺为难Hr;6月2日上午回绝hr: 问:陈姐,我有件重要的事忘记问了,在昭 ...
- 几种判断asp.net中session过期方法的比较
方法一:最麻烦也是最容易想到的方法,在每个页面的page_load()方法里面判断: protected void Page_Load(object sender, EventArgs e) { if ...
- css中的列表属性
list-style-type设定引导列表的符号类型,可以设置多种符号类型,值为disc.circle.square等 list-style-image使用图像作为定制列表的符号 list-style ...
- Charlie's Change_完全背包&&路径记录
Description Charlie is a driver of Advanced Cargo Movement, Ltd. Charlie drives a lot and so he ofte ...
- 解决chrome同步问题
原方法为 修改文件:“C:\WINDOWS\system32\drivers\etc\hosts”,但是经常失败,需要重新修改,很是麻烦. 更好的方法是使用 “谷歌访问助手(chrome版)” 具体参 ...
- js缓速运动
<html> <head> <meta http-equiv="Content-Type" content="text/html; char ...
- Android Packaging Problem
android Description Resource Path Location Type Error generating final archive: Debug Certificate ex ...
- 安装完openfire之后打不开的解决方案
今天在http://www.igniterealtime.org/downloads/index.jsp下载了一个最新openfire for mac版 在系统的偏好设置里面是这样的.那个open A ...
- ZMMR106-批量更新PO交货日期
************************************************************************ Title : ZMMR106 ** Applicat ...
- C++ Primer:第八章:IO库(续)
二:文件输入输出. (1) 使用文件流对象: 头文件fstream定义了三个类型来支持文件IO:ifstream从一个给定的文件中读取数据,ofstream向一个给定的文件中写入数据,以及fstrea ...