Skip to content

Databases

InnoDB buffer pool

Learn what the InnoDB buffer pool does and how to think about its size on VPS and shared hosting.

Updated Aug 29, 20263 min read10 reads
InnoDB buffer pool
How the InnoDB buffer pool caches data in RAM

The InnoDB buffer pool is the main memory cache MariaDB uses for table and index pages. When a query runs, InnoDB tries to serve those pages from RAM instead of reading the disk every time. On a VPS you choose the size yourself with root access. On shared hosting you do not set it, because the database daemon and pool are managed for everyone on the server.

How the pool relates to your data on disk

InnoDB stores tables in .ibd files, and sometimes in a shared tablespace. The engine loads pages from those files into the buffer pool and later writes dirty pages back to disk. If the working set you actually query fits in the pool, most work stays in RAM. If it does not fit, the database becomes disk-bound even when CPU looks quiet in tools like top. A small pool on a large dataset is a common reason a VPS feels slow under load.

Sizing the pool with PHP and LiteSpeed in mind

On a VPS, LiteSpeed, PHP, Redis if you use it, and MariaDB share the same RAM. Do not treat the buffer pool as whatever is left after you raise PHP workers as high as possible. For a database-heavy site, many people start around half to about seventy percent of RAM for the pool, then size PHP from what remains. If Redis holds a lot of hot data, leave more headroom for it. On shared hosting, CloudLinux LVE already limits your account, and you cannot change the shared MariaDB pool yourself.

Write load, dirty pages, and checkout traffic

Dirty pages and checkpoints matter when the site writes a lot. WooCommerce checkout is a good example: orders, order meta, stock, and sessions all hit the database. A pool that is too small fills with dirty pages, InnoDB flushes aggressively, and checkout can stall even when simple SELECTs still look fine. The main setting is innodb_buffer_pool_size. Log file size and flush options are secondary, and you should not drop a generic MySQL 8 config onto MariaDB without checking versions and defaults.

Character set problems are a separate layer. A correct utf8mb4 schema will not rescue a starving pool, and a large pool will not fix mojibake. See utf8mb4 character sets when the issue is characters rather than disk wait time.

Share

Send this article

Need someone else to do this? Send them the link — the commands are in the article.

Tagged

Was this article helpful?

Be the first to rate this article.