The Buffer Pool: MySQL’s Most Important Piece of Memory
InnoDB does not read directly from disk on every query. It reads pages into the buffer pool and serves subsequent requests from memory. When a page is not in the buffer pool, MySQL goes to disk — and that is orders of magnitude slower.
The buffer pool hit rate tells you what fraction of reads are being served from memory. Below 95%, you are doing a lot of disk I/O that faster hardware or more memory could eliminate. The free page count tells you how much headroom you have left. Dirty page pressure tells you how aggressively the background flush threads are working.
All three together give you a picture of whether your working set fits in RAM.
InnoDBBufferPoolHealth.sql
Loading…
Reading the Results
Page Counters
| Variable | What It Tells You |
|---|---|
Innodb_buffer_pool_pages_total | Total pages in the pool — pool size ÷ 16 KB per page |
Innodb_buffer_pool_pages_data | Pages holding live data (clean + dirty) |
Innodb_buffer_pool_pages_free | Unallocated pages — your remaining headroom |
Innodb_buffer_pool_pages_dirty | Pages modified in memory but not yet flushed to disk |
Innodb_buffer_pool_wait_free | Requests that had to wait for a free page — non-zero means memory pressure |
Hit Rate
| Range | Interpretation |
|---|---|
| ≥ 99% | Excellent — nearly all reads served from memory |
| 95 – 99% | Acceptable for most workloads |
| < 95% | Working set does not fit in memory — disk I/O is a bottleneck |
| < 90% | Serious memory pressure — consider increasing innodb_buffer_pool_size |
What to Watch For
| Signal | What It Means |
|---|---|
| Hit rate below 95% | Buffer pool too small for the active working set |
pages_free near zero | Pool is fully allocated — no room for new pages without eviction |
High pages_dirty relative to pages_total | Flush threads not keeping up — risk of stall during checkpoint |
Innodb_buffer_pool_wait_free > 0 | Threads are stalling waiting for free pages — immediate memory concern |
Single pool instance with large innodb_buffer_pool_size | Consider multiple instances (innodb_buffer_pool_instances) to reduce mutex contention |
Gareth Winterman