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存储引擎会监控对表上 ...
随机推荐
- oracle中的cluster表
大家对通常oracle中的cluster的理解是不准确的,经常和sql server中的cluster index混淆.Cluster是存储一组table的一种方法,这些table共享同一数据块中的某 ...
- (转)HTML 5离线存储之Web SQL
原文:http://developer.51cto.com/art/201106/267357.htm HTML 5离线存储之Web SQL 2011-06-07 15:14 kkun kkun的博客 ...
- RabbitMQ、Redis
进程QUEUE,可以是父进程与子进程间进行交互,也可以是同属于一个父进程的子进程间的交互:如果要实现进程A与进程B之间的通信,就需要借助一个中间进程了,我们习惯称为消息队列. QQ无法直接与WORD通 ...
- PHP Filter
PHP filters are used to validate and sanitize external input. Validating data is determine if the da ...
- 小P的图论课 (模拟退火)
uses math; ; INF=; var n,m,i,x,y,sum,ans,delta:longint; map:..maxn,..maxn] of longint; flag:..maxn] ...
- 【转】Web应用的组件化开发(一)
原文转自:http://blog.jobbole.com/56161/ 基本思路 1. 为什么要做组件化? 无论前端也好,后端也好,都是整个软件体系的一部分.软件产品也是产品,它的研发过程也必然是有其 ...
- magnetom模板制作
我个人认为Magento模板制作的难点在于不了解Magento的架构,不会调动block.Magento的block调动几乎都是靠xml.在下面的内容会提及如何操作. 制作Magento模板的前提是: ...
- asp.net MVC 常见安全问题及解决方案
asp.net MVC 常见安全问题及解决方案 一.CSRF (Cross-site request forgery跨站请求伪造,也被称为“one click attack”或者session rid ...
- matlab 字符分割
http://blog.csdn.net/gotomic/article/details/7898307 注意到以'.'分割时,写成'\.'.前者代表其他含义.可通过help regexp来查询. 例 ...
- Yocto 包管理 apt-get
/******************************************************************** * Yocto 包管理 apt-get * 说明: * 查一 ...