HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMinor

What does "cleaning up" mean in MySQL InnoDB transaction status and how to prevent it?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
preventwhatinnodbmeanstatusmysqltransactiondoeshowand

Problem

In our database (MySQL 5.6.22 on RDS) we have a lot of transactions (~500) in a state "cleaning up" under the load:

> SHOW ENGINE innodb STATUS;
...
------------
TRANSACTIONS
------------
...
---TRANSACTION 70150348714, not started
MySQL thread id 132590, OS thread handle 0x2b2a712ca700, query id 10842420427   cleaning up
...


The only information I have found is:


The thread has processed one command and is preparing to free memory and reset certain state variables.

https://dev.mysql.com/doc/refman/5.6/en/general-thread-states.html

And this question comment mentions:


You may need to fine tune some memory related parameters if you see this often in your instance.

Many transactions are getting stuck in the "cleaning up" state - what could cause that?

What could be the actual problem? Why are so many transactions in "cleaning up" state? What memory parameters can I fine tune to prevent it?

Any advice will be greatly appreciated.

Solution

To quote the man himself:


Hi!


Yes, you can get processes in the 'cleaning up' state if your
table_cache is too small.


The general answer is that you should increase your table cache if the
status variable 'opened_tables' tend to increase a lot over time.


Yours,
Monty

Source: Grokbase.com

Context

StackExchange Database Administrators Q#120584, answer score: 2

Revisions (0)

No revisions yet.