How to Get the InnoDB Buffer Pool Size via SSH

InnoDB is the default storage engine for MySQL databases – the same one that runs WordPress. To optimize speed, InnoDB stores frequently queries and indexes in cached memory. This way, we don’t have to query the database from disk each time. The result is that WordPress runs much faster. Obviously the bigger the cache, the more data InnoDB can store in it, and the bigger benefits for your site. So how big is this buffer exactly? This tutorial will show you how to get the InnoDB buffer pool size using SSH.

To get this, we need to do the following:

  1. Get SSH Access to the site via cPanel
  2. Enter the MySQL environment and query the engine
  3. Convert the value into GB

Let’s get started!

Step 1: Get Access to SSH from cPanel and Login

There’s no way to get the InnoDB buffer size directly from the cPanel GUI. For that, we need to log into the server via SSH. These days, most hosts allow access to SSH even on their shared hosting plans. With some, you need to send them an e-mail. With others, you need to just fill out a form. Yet others like SiteGround for example, have it enabled by default.

Here’s my earlier tutorial on how to set up SSH from cPanel. Once you’re done with that, come back here for step 2.

Step 2: Enter the MySQL Environment and Query the Engine

I’m going to assume that you’ve logged into SSH with your private key and are sitting at the command prompt. To get the InnoDB variables, we need to first enter the special MySQL shell. We do this by typing this into the command line:

mysql

This will drop us to a command prompt that looks like this:

mysql>

As shown here:

Access the MySQL Shell
Access the MySQL Shell

Once you’re at the prompt, copy and paste the following into the command line:

SHOW VARIABLES LIKE 'innodb_buffer_pool_size';

This will print out a table like this:

Get the InnoDB Buffer Pool Size
Get the InnoDB Buffer Pool Size

The buffer size is stored in the variable called “innodb_buffer_pool_size”, and its value in bytes is in the second column. This is the size of the InnoDB cache in which MySQL stores its most frequent queries and indexes.

Step 3: Convert the Byte Value into GB

The byte value is meaningless to us until we convert it into something more useful like GB. You’re done! The value in GB is your InnoDB buffer pool size for MySQL.

About Bhagwad Park

I've been writing about web hosting and WordPress tutorials since 2008. I also create tutorials on Linux server administration, and have a ton of experience with web hosting products. Contact me via e-mail!

Speak Your Mind

*

WP-Tweaks