This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am providing a script for determining the size of innodb_buffer_pool_size in MySQL Server.
The Buffer pool is essential for the InnoDB engine because InnoDB maintains the storage area for caching data and indexes in memory.
I have a 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 script to calculate the 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 in 2 RIBPS, so you require 2 GB size of the buffer pool.
You can change this parameter in the config file and restart your MySQL Service.
InnoDB reserves additional memory for buffers and control the structures, so that the total allocated space is approximately 10% greater than the specified size.