Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2015 November MySQL: Script to determine the size of innodb_buffer_pool_size

MySQL: Script to determine the size of innodb_buffer_pool_size

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.

1
2
3
4
5
6
7
SELECT
CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) AS RIBPS
FROM
(
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.

Nov 29, 2015Anvesh Patel
PostgreSQL: Performance difference between VARCHAR and VARCHAR(n)Database Theory: What is a Data Masking ?
Comments: 8
  1. meagan
    December 6, 2015 at 8:18 pm

    You really make it seem so easy with your presentation but I find this topic to be actually something
    which I think I would never understand. It seems too
    complicated annd very broad for me. I’m looking forward for ypur next post,
    I will try to get thhe hang of it!

  2. Jas
    December 15, 2015 at 9:57 pm

    Howdy! This post couldn’t be written any better!
    Looking through this post reminds me of my previous roommate!
    He continually kept talking about this. I’ll send thus information to him.
    Fairly certain he’ll have a great read. Thank you for sharing!

  3. Jenny
    December 28, 2015 at 7:36 pm

    This is one awesome article post. Really Great.

  4. faye valentine
    December 29, 2015 at 9:13 pm

    Im grateful for the blog post.Thanks Again. Really Cool.

  5. Camery
    February 25, 2016 at 8:13 am

    magnificent post, very informative. I wonder why the other experts of this sector don’t notice this. You should continue your writing. I’m sure, you’ve a great readers’ base already!

  6. Rutha
    March 3, 2016 at 9:28 am

    Major thanks for the post.Really looking forward to read more. Really Cool.

  7. Urfer
    March 30, 2016 at 8:35 pm

    Very informative article post. Really Great.

  8. Badal Singh Dudy
    March 2, 2020 at 8:00 am

    Hello Anvesh,

    I check this script on my production environment but its showing some unexpected answer

    Script output:-
    SELECT CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) AS RIBPS FROM( SELECT SUM(data_length+index_length) Total_InnoDB_Bytes FROM information_schema.tables WHERE engine=’InnoDB’) AS T;
    +——-+
    | RIBPS |
    +——-+
    | 163 |
    +——-+
    1 row in set (8.42 sec)

    Current environment:-
    buffer_pool_size is 4 GB total memory size is 11 GB

    Total DB size is 105 GB.

    Please let me know don i miss something???
    buffer pool size is 4 GB total memory size is 11 GB

Anvesh Patel
Anvesh Patel

Database Engineer

November 29, 2015 MySQL, MySQL DBA ScriptAnvesh Patel, buffer, database, database research and development, dbrnd, innodb, innodb_buffer_pool_size, MySQL, MySQL Command, MySQL Database Administrator, MySQL Database Designing, MySQL Database Programming, MySQL Error, MySQL Performance Tunning, MySQL Query, MySQL Tips and Tricks
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....