75% of RAM for Innodb_buffer_pool size
-
11-12-2020 - |
Question
I have read many documentation including percona and MariaDB documentation where they recommend setting innodb_buffer_pool_size to 70-80% of RAM. My question is, is that total RAM or available RAM? For example, when i run free -m on my CentOS-6.5, i get the following:
[root@master5 ~]# free -m
total used free shared buffers cached
Mem: 19991 999 10992 0 38 92
-/+ buffers/cache: 867 19123
Swap: 1999 0 1999
So is it 75-80% of 19991 or that of 10992?
Solution
Total, but remember that is only a rule of thumb. Use common sense when setting the value. InnoDB does like as much memory as possible, but there are a couple things to consider:
1) Make sure there is enough RAM left over for everything else that needs to run on the server
2) Remember that the point of the InnoDB buffer pool is to handle the normal working set of your data. How large is your database total, including some growth factor? There's no real need to set the buffer pool much more than that, even if you have the RAM. But your working set of data (what is used in day-to-day activities) is often lower than the total size of the DB. How much does it really need to keep in RAM for best performance?