Scrivio Interview library
ScenarioIntermediate6 min read · updated 12 November 2026

A MySQL 8.4 server with 64 GB RAM has innodb_buffer_pool_size=8G. Reads are slow and disk read IOPS are high. How do you size the buffer pool, what metrics confirm the problem, and can you change it without a restart?

On a dedicated 64 GB database host, the buffer pool is usually 60 to 75 percent of RAM, around 40 to 48 GB, leaving room for per-connection buffers, the operating system and other processes; 8 GB is far too small if the working set is larger. We confirm it by comparing Innodb_buffer_pool_reads, which count reads that had to go to disk, with Innodb_buffer_pool_read_requests, and by estimating the working set. In MySQL 8.4 the pool can be resized online, in chunks, though it causes short stalls, so we do it at a quiet time.

Why this question is asked

A buffer pool that is too small is one of the most common causes of slow MySQL reads, and it often comes from a configuration copied from a smaller server. The server has plenty of free memory, yet every other query waits on disk. Interviewers ask this scenario to see whether we can prove the diagnosis with metrics, choose a sensible size, and change it without an outage. In this answer, we will recap what the buffer pool does, confirm the problem with the right counters, choose the new size, resize it online, and keep the cache warm across restarts.

1A Quick Recap of the Buffer Pool

InnoDB reads and writes data in 16 KB pages, and the buffer pool is the memory area where it caches them. A query that finds its pages in the pool runs at memory speed; a query whose pages are missing waits for a disk read, which on cloud storage might be 0.5 to 2 ms per page. A query touching 1,000 uncached pages can easily take a second.

The pages a workload uses regularly are its working set. If the working set fits in the pool, almost every read is a hit. If it is, say, 30 GB and the pool is 8 GB, pages are constantly evicted and read again, which is exactly the pattern of high disk read IOPS and slow reads.

2Confirming the Problem With Metrics

Two status counters tell the story. Innodb_buffer_pool_read_requests counts logical page reads, every time InnoDB asked for a page. Innodb_buffer_pool_reads counts the reads that missed the pool and went to disk. Their ratio is the miss rate. We sample both twice, a minute apart, to see the current rate rather than the total since startup.

Java
SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_read%';
-- Innodb_buffer_pool_read_requests | 9 812 004 120
-- Innodb_buffer_pool_reads | 61 540 233
-- 60 seconds later: +4 200 000 requests, +126 000 disk reads
-- miss rate = 126000 / 4200000 = 3 percent (a healthy OLTP pool is usually well below 0.1 percent)
SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_pages_free'; -- 0: the pool is full
SELECT ROUND(SUM(data_length + index_length) / POW(1024, 3), 1) AS gb
FROM information_schema.TABLES WHERE table_schema = 'shop';
-- 34.6

Notice that a 3 percent miss rate sounds small but means about 2,100 disk reads per second, matching the high read IOPS. A full pool with no free pages and a high rate of pages made young and evicted confirms that the pool is churning.

To estimate the working set, we compare the pool with the data size. information_schema.TABLES gives data and index sizes per table, and if the frequently accessed tables and their indexes add up to 30 GB, an 8 GB pool can never hold them.

3Choosing the New Size

On a dedicated database server, a common rule is 60 to 75 percent of RAM for the buffer pool. On 64 GB, that is 38 to 48 GB. The rest is needed for things outside the pool: per-connection buffers such as sort_buffer_size and join_buffer_size, which multiply by active connections, temporary tables, the operating system, and monitoring agents. Going to 60 GB would risk the out-of-memory killer under load.

Here, with a 35 GB data set and 64 GB of RAM, 44 GB holds the whole working set with headroom for growth. If the data set were 500 GB, the pool could not hold everything, and the goal would be to hold the hot part, measured by the miss rate after the change.

Where 64 GB goes after resizing
UseSizeNotes
InnoDB buffer pool44 GBabout 70 percent of RAM, holds the working set
Per-connection buffersup to 8 GBsort and join buffers times active connections
Redo log buffer, other InnoDB memory1 to 2 GBlog buffer, data dictionary, AHI if on
Operating system and agents8 GB or morekernel, file cache, monitoring
Leave room outside the pool: running out of memory is worse than a smaller cache.

4Resizing Online

Since MySQL 5.7, innodb_buffer_pool_size can be changed at runtime with SET GLOBAL. InnoDB grows or shrinks the pool in units of innodb_buffer_pool_chunk_size, 128 MB by default, and the final size is rounded to a multiple of the chunk size times the number of buffer pool instances. The resize runs in the background, and its progress is visible in a status variable.

SQL
SET GLOBAL innodb_buffer_pool_size = 44 * 1024 * 1024 * 1024;
SHOW STATUS LIKE 'Innodb_buffer_pool_resize_status';
-- Completed resizing buffer pool at 261105 10:42:18.
SELECT @@innodb_buffer_pool_size / POW(1024, 3); -- 44
-- and make it permanent
SET PERSIST innodb_buffer_pool_size = 47244640256;

But there is a catch: while chunks are added, InnoDB briefly holds internal locks, and shrinking is more disruptive than growing because pages must be moved out of the chunks being freed. So we resize during a quiet period and watch latency. SET PERSIST writes the value to mysqld-auto.cnf so it survives a restart; otherwise we change the configuration file too.

There is also innodb_dedicated_server, which, on a server used only for MySQL, sizes the buffer pool and the redo log capacity automatically from the detected memory. It is convenient for standard hosts, but the exact formulas have changed between versions, so check your version's documentation before relying on it.

5Keeping the Cache Warm Across Restarts

After a restart, the buffer pool is empty, and the first minutes or hours are slow while the working set is read back from disk. InnoDB can save the list of pages in the pool at shutdown and reload them at startup. innodb_buffer_pool_dump_at_shutdown and innodb_buffer_pool_load_at_startup are on by default, and innodb_buffer_pool_dump_pct, 25 by default, controls what share of the most recently used pages is saved. Only page identifiers are saved, so the dump file is small, and the reload runs in the background.

Java
SHOW STATUS LIKE 'Innodb_buffer_pool_load_status';
-- Buffer pool(s) load completed at 261105 10:51:02
SET PERSIST innodb_buffer_pool_dump_pct = 50; -- keep more of the working set warm

6Follow-up questions

What happens to the buffer pool when a large mysqldump runs?

mysqldump reads whole tables, so it touches every page once. Thanks to the midpoint LRU, those pages enter the old sublist and are only promoted to the young sublist if they are read again after innodb_old_blocks_time, so most of the hot working set stays young. Even so, the old sublist churns and the dump adds disk reads, so large dumps are better run against a replica, or replaced with a physical backup tool.

Why not set the pool to 90 percent of RAM?

Because memory outside the pool is real. Connections allocate sort and join buffers, temporary tables use memory, and the operating system needs room. If MySQL runs out, the kernel's out-of-memory killer ends mysqld, which is far worse than a slightly smaller cache.

How do you know the resize worked?

By sampling the same counters again: the disk read rate, Innodb_buffer_pool_reads per second, should fall sharply once the working set is cached, disk read IOPS should drop, and query latency should return to normal.

7Conclusion

In this answer, we confirmed a too-small buffer pool by sampling Innodb_buffer_pool_reads against Innodb_buffer_pool_read_requests and comparing the data size with the pool. We chose about 70 percent of RAM, 44 GB on a 64 GB dedicated host, leaving room for connection buffers and the operating system, resized it online in chunks during a quiet period with SET GLOBAL and SET PERSIST, noted that innodb_dedicated_server can size it automatically on standard hosts, and kept the cache warm across restarts with the buffer pool dump and load settings.

What to say in the interviewAbout 90 seconds aloud

Open with

With 64 GB and an 8 GB pool, I would expect the working set not to fit, but I would prove it first. I sample Innodb_buffer_pool_reads and Innodb_buffer_pool_read_requests a minute apart: reads are the misses that went to disk, so their ratio is the miss rate, and on a healthy OLTP pool it is well under a tenth of a percent.

Then, if they want more

If it is a few percent, the free pages are zero, and the data and index size in information_schema is around 35 GB, the pool is churning, which matches the high read IOPS.

On a dedicated host I would size the pool at 60 to 75 percent of RAM, so about 44 GB here, leaving memory for per-connection sort and join buffers, temporary tables, the OS and agents. I can change it without a restart: SET GLOBAL innodb_buffer_pool_size, and InnoDB grows it in chunks of innodb_buffer_pool_chunk_size, which I watch in Innodb_buffer_pool_resize_status.

It can cause short stalls, so I do it at low traffic, and I use SET PERSIST so it survives restarts. On standard hosts innodb_dedicated_server can size it automatically, though I would check the formula in our version.

Finally, I keep buffer pool dump at shutdown and load at startup on, so a restart does not start with a cold cache.

About this answer

Last updated
12 November 2026
Versions it names
MySQL 5.7, MySQL 8.4
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
MySQL reference manual
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "A MySQL 8.4 server with 64 GB RAM has innodb_buffer_pool_size=8G. Reads are slow and...": https://scrivio-interview-library.netlify.app/databases/mysql/0c12358320/