Pcornel
Browse topics
Options
Recent
Favorites
Databases · Technical reference

InnoDB Buffer Pool

Direct answer

The InnoDB buffer pool caches data and index pages in memory; most MySQL/MariaDB performance depends on it fitting the working set.

When to use this

Use it when tuning MySQL/MariaDB memory or when reads hit disk too often.

First 30 seconds

1. SHOW VARIABLES LIKE 'innodb_buffer_pool_size';.

2. SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_read%'; — hit rate.

3. Working set vs size.

4. OS free memory left.

5. Adjust and monitor.

Operational verification

query → page in buffer pool? → else read from disk → cached

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
MariaDB / MySQL / PostgreSQL / Microsoft SQL Server concepts
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformMariaDB / MySQL / PostgreSQL / Microsoft SQL Server concepts
Key commandSHOW VARIABLES LIKE 'innodb_buffer_pool_size';
Scope / prerequisiteUse it when tuning MySQL/MariaDB memory or when reads hit disk too often.
What next?2 suggested next steps
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 How to verify Verify boundary

Compare Innodb_buffer_pool_reads with Innodb_buffer_pool_read_requests over an interval. Check free memory on the host so the server does not swap.

Step 2 Sizing and checks Verify boundary
SHOW VARIABLES LIKE 'innodb_buffer_pool_size';
SHOW ENGINE INNODB STATUS\G      -- BUFFER POOL AND MEMORY
SELECT (1 - (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME='Innodb_buffer_pool_reads')
          / (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME='Innodb_buffer_pool_read_requests')) AS hit_ratio;

On a dedicated server use ~60–75 % of RAM. A hit ratio below ~99 % on an OLTP workload suggests the working set does not fit. Resizable online since MySQL 5.7 / MariaDB 10.2.

Step 3 Common failures Narrow the fault

A buffer pool larger than free RAM causes swapping and very slow queries. Leaving the default (128 MB) on a large database makes every query hit disk. Many other per-connection buffers add to memory use.

Key points

On a dedicated server set innodb_buffer_pool_size to about 60–75 % of RAM. Hit rate = 1 − reads/read_requests. Resizable online in recent versions.

Key checks
  • SHOW VARIABLES LIKE 'innodb_buffer_pool_size'; — first check for this topic
  • psql -c "SELECT now(), version();" — PostgreSQL reachable and version
  • mysql -e "SELECT NOW(), VERSION();" — MariaDB/MySQL reachable and version
  • sqlcmd -S <server> -Q "SELECT @@VERSION" — SQL Server reachable and version
ReferenceWhat it is1 section · depth on demand

How it works

InnoDB reads pages into the buffer pool and keeps the most used ones with an LRU list. Changed (dirty) pages are flushed to disk in the background. Innodb_buffer_pool_reads counts reads that had to go to disk.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Sizing

On a dedicated database server the buffer pool commonly gets 50–75 % of RAM (the manual mentions up to 80 % on dedicated servers). Leave room for per-connection buffers (sort_buffer_size, join_buffer_size, temporary tables) times the number of active connections, the OS, and any other processes. On MySQL 8.4 innodb_dedicated_server = ON sizes the buffer pool and redo log automatically from detected memory.

SET GLOBAL innodb_buffer_pool_size = 24 * 1024 * 1024 * 1024;   -- online resize, in chunks
SELECT VARIABLE_VALUE FROM performance_schema.global_status
WHERE VARIABLE_NAME = 'Innodb_buffer_pool_resize_status';

Is it big enough?

Measure misses over an interval, not since start-up:

SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_read%';
-- Innodb_buffer_pool_read_requests  (logical reads)
-- Innodb_buffer_pool_reads          (had to go to disk)

Take two samples a few minutes apart; if reads grows by more than about 1 % of read_requests during normal load, and disk read latency is visible in query times, the working set does not fit.

Midpoint insertion and scans

New pages enter the LRU list at the head of the old sublist (3/8 of the pool by default) and only move to the young part if accessed again after innodb_old_blocks_time (1 s). That stops a single large scan, such as a backup or report, from evicting the hot data.

Warm restart

innodb_buffer_pool_dump_at_shutdown and innodb_buffer_pool_load_at_startup (both on by default) save the list of hot pages and reload them after a restart, so performance recovers in minutes instead of hours.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Common mistakes

  • Buffer pool too small or larger than RAM allows.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
innodb buffer poolinnodb buffer pool sizemysql memory tuning
Confirmation

Confirm action

Continue?