Database Administration — Tue Apr 07

← Home | ← database-admin

MySQL - DBA Toolkit - InnoDB Buffer Pool Health

Tue Apr 07 — Check InnoDB buffer pool hit rate, utilization, and dirty page pressure to understand whether your working set fits in memory.
#mysql #dba #monitoring #innodb #performance #tool-kit

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

VariableWhat It Tells You
Innodb_buffer_pool_pages_totalTotal pages in the pool — pool size ÷ 16 KB per page
Innodb_buffer_pool_pages_dataPages holding live data (clean + dirty)
Innodb_buffer_pool_pages_freeUnallocated pages — your remaining headroom
Innodb_buffer_pool_pages_dirtyPages modified in memory but not yet flushed to disk
Innodb_buffer_pool_wait_freeRequests that had to wait for a free page — non-zero means memory pressure

Hit Rate

RangeInterpretation
≥ 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

SignalWhat It Means
Hit rate below 95%Buffer pool too small for the active working set
pages_free near zeroPool is fully allocated — no room for new pages without eviction
High pages_dirty relative to pages_totalFlush threads not keeping up — risk of stall during checkpoint
Innodb_buffer_pool_wait_free > 0Threads are stalling waiting for free pages — immediate memory concern
Single pool instance with large innodb_buffer_pool_sizeConsider multiple instances (innodb_buffer_pool_instances) to reduce mutex contention

Gareth Winterman