Thursday, August 30, 2018

How much RAM to assign to MySQL

How you should tune your innodb_buffer_pool_size

70% to 80% is maybe a great start and rule of thumb.  You want to be sure the server has plenty of free RAM for the OS and other workload.  

Changing the InnoDB buffer pool requires a restart in 5.7- releases.

You tune the innodb_buffer_pool_size as large as possible without using swap when the system is running the production workload. 

MySQL 5.7 has online buffer pool resize feature which makes this an easier principle to follow. 

  • Seeing lots of free RAM (and/or filesystem cache usage)?  Turn the buffer pool up dynamically. 
  • Seeing some swap activity?  Just turn it down with no restart required.