In this post, I am providing a script to determine the size of innodb_buffer_pool_size in MySQL Server.
The Buffer pool is very important for the InnoDB engine because InnoDB maintains this storage area for caching data and indexes in memory.
I have one rough figure like, if you have 3 GB of InnoDB data and indexes, you require at least 1 GB size of innodb_buffer_pool_size.
Below is a one script to calculate require size for InnoDB buffer pool.
CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) AS RIBPS
SELECT SUM(data_length+index_length) Total_InnoDB_Bytes
FROM information_schema.tables WHERE engine='InnoDB'
) AS T;
After executing above statement, You will get one RIBPS value. e.g. result 2 RIBPS so you require 2 GB size of the buffer pool.
You can change this parameter in mysql in config file and restart your MySQL Service.
InnoDB reserves additional memory for buffers and control structures, so that the total allocated space is approximately 10% greater than the specified size.