Sizing InnoDB’s Buffer Pool on a Game Node: The Memory Budget Behind the World Saves

TL;DR: On a game server, InnoDB rarely gets 70% of RAM — the game process does. Allocate RAM to the world simulation first, give MySQL whatever remains after a measured working-set check, and verify with reads-from-disk, not with a formula. On most 64–128 GB game boxes the buffer pool lands between 8 and 32 GB, with 4–8 GB of redo log and a hard cap on connection buffers.

Why the database is the second tenant, not the first

A dedicated game server is a mixed workload: the simulation (or several instances of it) is latency-sensitive and bursty, the database behind permissions, economy, shop history and logs is throughput-sensitive and mostly idle between saves. The classic MySQL advice — “set the buffer pool to 70% of RAM” — was written for machines that do nothing else. Follow it on a 96 GB host running two Minecraft instances at 12 GB each plus a panel and a proxy, and you have promised 67 GB to InnoDB and left the actual game competing for the rest.

The order of allocation matters more than any single number. Size the game; reserve the OS and page cache; then size the pool from the data the queries actually touch.

Build the memory budget in the right order

Do the arithmetic on one page before touching my.cnf:

  1. Game processes. Sum of JVM heap or native RSS ceilings, plus 15–20% headroom per instance for off-heap buffers, JIT code cache, thread stacks and GC structures. A “12 GB” Minecraft instance is routinely 14.5 GB resident.
  2. Panel, proxy and agents. Pterodactyl/Pelican panel, a Velocity or BungeeCord proxy, anti-cheat agents, monitoring exporters. Usually 1–3 GB on a busy node.
  3. OS and page cache. 2–4 GB absolute reserve, more if you stream world saves and mod files from disk.
  4. Database. Whatever is left, minus the connection and log overhead described below.

If step 4 produces a number smaller than your measured working set, the host is undersized for the workload — do not fix it by shrinking the game’s share. That trade produces stutter during save bursts, which players notice far more than a database query running 3 ms slower.

Measure the working set with game-specific queries

Enable the slow query log with a threshold that actually captures your traffic — on a game backend most queries are sub-millisecond, so long_query_time = 1 shows you nothing. Use 0.05–0.1 s for a week, and add log_queries_not_using_indexes only temporarily, because it writes a lot.

Then compute the real hot set rather than guessing from table sizes:

SELECT table_name,
       ROUND(data_length/1024/1024) AS data_mb,
       ROUND(index_length/1024/1024) AS idx_mb,
       rows_read
FROM information_schema.tables t
JOIN (
  SELECT object_name, count_read AS rows_read
  FROM performance_schema.table_io_waits_summary_by_table
) io ON io.object_name = t.table_name
WHERE table_schema = 'gamedb'
ORDER BY rows_read DESC
LIMIT 20;

On a typical survival server the hot set is player data, permissions, economy balances and the ban/whitelist tables — often under 4 GB even when the database file is 60 GB because world region data lives in files, not MySQL. Read-heavy reporting tables, vote logs and chat history dominate on paper and barely matter in practice. A 60 GB database with a 6 GB hot set does not need a 48 GB pool; it needs indexes and a well-funded game process.

Why “70 percent of RAM” fails on game hosts

The heuristic assumes the pool is the only large consumer and that free memory is wasted. Neither holds here. On a 64 GB node with 40 GB committed to game instances, 70% would claim 45 GB and force the kernel into reclaim during the daily save burst — swap-in storms that show up as tick spikes nobody can attribute to the game.

Oversizing also lengthens restarts. MySQL allocates and zeroes the pool at startup; a 48 GB pool on DDR4 adds 20–40 seconds to every service restart, which matters when your restart orchestration is already holding players at a “server restarting” screen. On a machine that reboots for kernel updates at 4 a.m., that is a window where the proxy routes traffic to a backend that is not listening yet.

Buffer pool instances, chunk size and NUMA sockets

Above roughly 8 GB the single-instance mutex starts to matter; set innodb_buffer_pool_instances to 4 or 8, not 1 per GB. Remember the constraint that trips people up: the total pool size is rounded down to a multiple of innodb_buffer_pool_chunk_size × innodb_buffer_pool_instances. With a 128 MB chunk and 8 instances, asking for 10 GB silently gives you 9.75 GB. Ask for a multiple and confirm in the startup log.

On a dual-socket host, check whether the BIOS interleaves memory across nodes. A pool allocated on one NUMA node while the game processes run on the other turns every page lookup into a cross-socket hop. For game hosts the simplest fix is BIOS interleaving; pinning MySQL to a socket shared with an idle game instance is the fallback. The same node-locality logic that applies to the game thread applies to the database worker threads.

Connection overhead is the hidden line item

Every MySQL connection carries per-thread buffers: sort_buffer_size, join_buffer_size, read_buffer_size, read_rnd_buffer_size. Defaults are small, but plugin authors love to raise them. 300 connections at 4 MB of combined buffers is 1.2 GB that appears from nowhere in your budget.

Audit with SHOW GLOBAL STATUS LIKE 'Threads_connected' at peak, then multiply by the sum of your buffer settings and compare with SHOW GLOBAL STATUS LIKE 'Threads_running'. On game backends the usual culprit is a plugin opening a connection per player action and never pooling. Fixing that — or putting ProxySQL in front — buys more headroom than any pool tuning.

Redo log, temp tables and the rest of the budget

The buffer pool is not the budget. Reserve for:

  • Redo log: 2–8 GB for most game databases. Size for the save burst, not the average. Innodb_os_log_written per hour divided by 3600 gives a sanity check on bytes per second.
  • Temp tablespace: cap with innodb_temp_data_file_path so a runaway query cannot fill the disk that also holds world saves.
  • Performance schema: 0.5–2 GB on a busy server; disable consumers you never read.
  • Binlogs if you replicate: disk, not RAM, but they share the same NVMe as the world files.

Treat the disk budget as seriously as the memory budget: the database, the saves and the backups usually live on the same NVMe array, and a binlog that grows unchecked during a long transaction has taken more game servers offline than buffer pool misconfiguration ever did.

Verify the change without guessing

MySQL 8 can resize the pool online with SET GLOBAL innodb_buffer_pool_size. Do it in a quiet window anyway. Then watch two counters for an hour of representative traffic:

SHOW GLOBAL STATUS WHERE Variable_name IN
 ('Innodb_buffer_pool_reads','Innodb_buffer_pool_read_requests',
  'Innodb_buffer_pool_pages_free','Innodb_buffer_pool_wait_free');

For an OLTP game backend, reads served from memory should exceed 99%. If doubling the pool moves that ratio by less than half a point, the pool was never the problem — the problem is a query scanning the whole economy table on every login. Go read execution plans. If Innodb_buffer_pool_wait_free is climbing, the pool is under pressure from dirty-page flushing, not from being too small.

Tuning knobs worth pairing with the pool

Two settings do more for game workloads than another 4 GB of pool:

  • innodb_flush_log_at_trx_commit — leave at 1 for economy and account data. Never relax it on a table holding player purchases; the second you save per transaction is not worth a rolled-back purchase during a crash.
  • innodb_io_capacity — on NVMe, 2000–4000 is reasonable, not the 200 default. Under-provisioned IO capacity makes the pool look undersized because dirty pages cannot drain fast enough.

Resist the urge to tune twenty variables. On a game host the ordering is: correct budget, correct indexes, correct flush policy, and only then pool size.

A one-page record for the next hardware refresh

Write down, dated: measured working set, pool size, instances and chunk size, redo log, connection headroom, OS reserve and peak free memory after a full save cycle. When the community grows and someone proposes another 64 GB of RAM, that page answers the question in a minute: is the box short on memory for the game, or short on indexes for the database? One is a purchase, the other is an afternoon with EXPLAIN.

Hardware you rent should be sized against this page, not against a plan’s marketing tier. If you are still choosing between shapes of machine, our guide to high-traffic dedicated server hardware covers the CPU and NVMe side of the same budget, and how much RAM and CPU a dedicated server really needs gives the game-side half of the arithmetic.

Related: RAM requirements by player count and reading RAM and disk usage metrics for capacity planning.

Buffer pool sizing is ultimately a RAM purchasing decision, and RAM is the line item that moves most between tiers. The dedicated server plans list memory per configuration, and the main site explains which workloads each tier is built for.