Using SHOW PROCESSLIST and mysqladmin debug Output in Conjunction with SHOW INNODB STATUS
2015-01-05 00:58
666 查看
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:
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/
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/
相关文章推荐
- mysqladmin processlist; show processlist; show status;
- mysqladmin processlist; show processlist; show status;
- Populate A List Item With Record Group In Oracle Forms Using Populate_List And Create_Group_From_Query Command
- show processlist 输出ID 和 information_schema.PROCESSLIST 的id,information_schema.innodb_trx的TRX_MYSQL_T
- mysql binlog to sql and show mysqlstatusadmin
- Populate A List Item With Record Group In Oracle Forms Using Populate_List And Create_Group_From_Query Command
- show processlist 输出ID 和 information_schema.PROCESSLIST 的id,information_schema.innodb_trx的TRX_MYSQL_T
- 作为开发者必须掌握的mysql操作sql语句优化 - show processlist and explain
- Using gdbserver and arm-eabi-gdb to debug native code in Android
- mysql show processlist state
- mysql show processlist state
- [MySQL FAQ]系列 -- show engine innodb status显示信息不全?
- using JS to control two select(html),the data can be loaded from database and XML,and show in the select
- mysql show processlist命令 详解
- mysql show processlist命令详解
- mysql show processlist命令 详解
- 通过mysql show processlist 命令检查mysql锁的方法
- mysql show processlist命令 详解
- Accessing List Data using the JavaScript Client OM and displaying in a Dialog
- mysql show processlist 命令详解