Let's say we have a transaction running 50,000 inserts which dirties approximately 600 MB of the database. If the buffer pool size is 128 MB, there will be dirty pages in the buffer pool while the transaction is running, and these will need to be evicted to make space. My question is, what does MySQL/InnoDB do with these dirty uncommitted pages?
Mysql – What happens when MySQL/InnoDB buffer pool size is small and a large transaction is run causing the buffer pool overflow
innodbmariadbMySQLmysql-5.5
Related Question
- MySql Memory problem & swap is 100%
- Mysql – Would the MySQL database benefit from increasing the InnoDB buffer pool size
- Mysql – How does MySQL evict pages from the buffer pool
- Mysql – In InnoDB, how does fuzzy checkpointing’s recovery consistency work
- Mysql – What’s the exact meaning of `innodb_max_dirty_pages_pct`, and how does it relate to the redo log
- Innodb – Partitioning and the InnoDB Buffer Pool
Best Answer
I just encountered a question 5 days ago : InnoDB errors and crashes with MyISAM database?
When troubleshooting the issue in a live chat session, I discovered that dirty pages from Temporary InnoDB Tables were occupying the InnoDB Buffer Pool. The file ibtmp was 482MB with 75% of the buffer pool being dirty since innodb_max_dirty_pages_pct was 75. The Buffer Pool was only 128M. So, then, what happens ?
The Buffer Pool has to flush very frequently when the Buffer Pool is too small (which is what I encountered with a virtually empty database).
If you run
SHOW GLOBAL STATUS LIKE 'innodb_buffer_pool%';
, you will see something like this:You can monitor
Innodb_buffer_pool_pages_dirty
withThis number may fluctuate with pages being flushed and pages coming in, but this will definitely bottlenck InnoDB. Your solution is just to increase the Buffer Pool size.
I talked about other ill effects before (See my post what happens when InnoDB logspace is too small)