• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
  • VPS
    • VPS Hosting
    • Flex VPS
  • Reseller
  • Email
  • Gaming
  • Domains
  • Website Builder
  • Account
  • Blog Home
  • Categories
  • Authors

How To Increase The InnoDB Buffer Pool Size

Bhagwad Park

Published on: December 9, 2021

Categories: Showcase, VPS Hosting 0

Updated: May 1, 2023

One of the ways you can speed up your dynamic page generation is by increasing the amount of RAM your database uses for storing its queries and temporary objects.

For WordPress sites, this is called the InnoDB buffer pool size. A lot of people on shared hosting don’t have the permissions to access the interface necessary to change this pool size. But if you’re on a VPS, then you can go directly into the MySQL configuration file, make the change, restart the MySQL server, and you’re done!

  • What Should be the Size of the Buffer Pool?
  • Step 1: Locate the my.cnf File for MySQL
  • Step 2: Take Backups of my.cnf
  • Step 3: Change the Value of the InnoDB Buffer
  • Step 4: Restart MySQL

What Should be the Size of the Buffer Pool?

By default, the InnoDB buffer pool size is 128 MB. This might or might not be enough for you. However, the MySQL documentation states that you can safely increase the size of the buffer to up to 80% of your available RAM on a VPS or a dedicated server! Clearly this is too much if you’re hosting in a shared environment, but it recommends that such users start at 10% just to see what works and what doesn’t.

So if your VPS server has 2 GB of free RAM, and if you want to follow the recommendations of MySQL, you could increase the innodb buffer size from 128 MB to around 1600 MB! For sites with large databases, and a huge number of visitors, that can really speed things up!

Step 1: Locate the my.cnf File for MySQL

The configuration file holding the global options for MySQL is called my.cnf. Its location varies depending on your OS. For example, I’m running CentOS 7 on my VPS, and so I can find it at /etc/my.cnf. Your location might vary. You can check the MySQL documentation to see where to find my.cnf for your operating system.

I should also mention that you need root privileges to modify this file. Otherwise, it’s saved in a read-only format. So either you sign in as root (not recommended), or you give your user sudo privileges to minimize the risk of damage. Now when you need to edit the my.cnf file, simply type “sudo” before the command, enter your account password, and you can modify the file.

Step 2: Take Backups of my.cnf

It should be easy to reverse the changes you make here, but take a backup just in case. You can accomplish this using the following steps.

  1. Navigate to the folder containing my.cnf
  2. Type cp my.cnf my.cnf.bk

This will copy the my.cnf file to another file called my.cnf.bk. Now if something goes wrong, you can delete my.cnf and rename the copy to the original.

You can verify the creation of your backup using the following command:

ls -l my*

Your output should look like this:

Once you’ve confirmed the backup, we move to the next step.

Step 3: Change the Value of the InnoDB Buffer

As mentioned, you need to use sudo to modify the my.cnf file. So something like:

sudo vi my.cnf

Is needed. Once you’ve opened it up, remove the hash (#) symbol next to the comment holding the following line:

innodb_buffer_pool_size=128M

This will “uncomment” the line. Now change it to whatever value you feel is necessary. In the above example, I changed it to 400 MB.

Save your changes, and you’re done! Now we just need one final step.

Step 4: Restart MySQL

Depending on your OS, the command to restart the MySQL server will vary. For me, it’s:

sudo systemctl restart mysqld

This restarts MySQL, and applies the changes in my.conf. Now your new InnoDB buffer pool size is active!

This is an easy tweak for those who have access to their VPS servers. It can help speed up your database, and reduce important metrics like TTFB times!

As always, if you’re a NameHero customer and you need help with any of the above, we’d be happy to assist. Simply open a support ticket in your area or start a live chat!

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Related Posts

How to Use Ufw to Open Port 80 in Linux

In Linux, particularly on Ubuntu system, here's how we can use ufw to open port 80. No need to mess with IPTables directly!

Using Systemctl to Enable Services on Boot on Linux

You can use the systemctl tool to start services automatically on boot. We do this using the "enable" keyword.

How to Merge a Git Branch to Master

Check out our guide on how to merge a git branch to the master branch, as well as some assumptions and considerations.

How to Grep Multiple Strings

In this tutorial, we cover using grep to search for multiple string patterns, using "OR" or "AND" logic and improving search efficiency.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup (2024)

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • Email Hosting
  • Game Hosting
  • Domains
  • Website Builder
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2025 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA