Skip to content

Instantly share code, notes, and snippets.

Improve MySQL performance by increasing RAM usage

MySQL comes with a strong caching mechanism that correct usage has dramatic impact on the the database performance. But it's not a plug and play functionality and some configuration is required. Below I'll show you how important this configuration is and what parameters you should set to get satisfying results.

Who should do it?

Although this configuration is very simple it's not for everyone. In case your host has less than 1G of RAM you shouldn't change the default MySQL config because it's going to damage the performance instead of improving it. My report is tested on a 12G RAM, 4 core CPU virtual machine and I choose the numbers that fit my system. In order find out what's best for you I recommend checking the following link: Calculating InnoDB Buffer Pool Size For Your MySQL Server

Install SysBench

.parent3d{
-webkit-perspective: 500px;
}
.parent{
width: 300px;
height: 400px;
margin: 100px auto 0;
width: 200px;
height: 200px;