Skip to content
gohacks.dev
Databases

MySQL InnoDB Tuning Calculator

Get starting values for innodb_buffer_pool_size, buffer pool instances, redo log capacity, I/O capacity and max_connections from memory, cores and storage.

Free · No sign-up · Your inputs stay in your browser

Input

Starting settings for MySQL / InnoDB

Output

my.cnf

296 characters

Buffer pool6.00 GB of 8 GB
Worst-case memoryabout 6.4 GB if every connection fills its session buffers at once

The buffer pool and redo log follow the rule MySQL 8.4 applies itself with innodb_dedicated_server=ON: half the memory up to 4 GB, three quarters above it, and a redo log of (cores / 2) GB up to 16. On a shared box the calculation starts from 40% of the memory instead. These are starting points; check the buffer pool hit rate and the slow log after a week of real traffic.

Runs in this browser. Nothing you paste is sent to a server.

The buffer pool is the setting

InnoDB caches data and index pages in the buffer pool, and a working set that fits in it is served from memory. On a dedicated server most of the memory belongs there. MySQL can size it itself: with innodb_dedicated_server enabled it uses half the memory up to 4 GB and three quarters above, and sets the redo log from the number of cores.

Check after a week

Starting values are a guess about your workload. After real traffic, compare Innodb_buffer_pool_read_requests with Innodb_buffer_pool_reads in SHOW GLOBAL STATUS: the second should be a tiny fraction of the first. The slow query log, enabled here at one second, shows where indexes are missing, which matters more than any setting.

Share

Frequently asked questions

Can innodb_buffer_pool_size be changed without a restart?
Yes, since MySQL 5.7 it can be resized online with SET GLOBAL; it changes in chunks of innodb_buffer_pool_chunk_size.
How many connections does MySQL need?
Your real peak: PHP-FPM workers on every app server, plus queue workers, cron jobs and admin tools. Setting it much higher only makes overload worse.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools