What is adaptive flushing in MySQL?

What is a dirty page?

In a database, dirty pages are the pages that have been changed in the buffer cache but have not been written to the disk. These pages are periodically flushed, typically when the percentage of dirty pages exceeds the configured value of innodb_max_dirty_pages_pct.

We have Pages A,C, D and G pulled into Main memory
1 of 3

Impacts of flushing

When excessive flushing takes place, the throughput of database read/write operations can be reduced because the I/O capacity for ordinary read and write operations is reduced.

Adaptive flushing

The InnoDB engine has a new algorithm to adapt the flushing based on heuristics derived from the speed of redo log generation and the number of dirty pages. The master thread decides how many pages to flush based on these numbers. This allows the flushing algorithm to deal with sudden workload spikes.

This feature can be enabled/disabled using the parameter innodb_adaptive_flushing.

New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources