Using show Processlist and Mysqladmin debug Output in conjunction with show INNODB STATUS

Source: Internet
Author: User

When InnoDB appears hung, I know the natural reaction are to check SHOW ENGINE InnoDB STATUS.

In fact, it's the first thing I check when InnoDB tables is involved.

However, I just want to iterate what valuable SHOW full processlist and/or mysqladmin debug outputs can be even when it see Ms Mysqld is hung on InnoDB table.

II 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 500m Ysql tables in use 1, locked 1...INSERT to test (ID, parent, text) VALUES (180370, 70122, ' Test table ')

At least this ' 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 is captured at the time.

Turns out, there is a *very* long SELECT running, but not from the same table, and no foreign keys (FKs) either. Turned out it is some crazy, auto-generated query that self-joined itself 548 times. So there were no locks, per se. This is a query itself held up everything, and thus also the INSERT.

Case #2:

This is a table that is also hanging on a certain and simple UPDATE. The UPDATE is based on Te PK, so only one row is to is updated.

Yet, it hung, and it hung, longer than wait_timeout, interactive_timeout, and innodb_lock_wait_time out. 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 the SHOW Processlist helped catch this offender.

At no rate, hope this helps, and happy troubleshooting.

Reference:

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.