How to make MariaDB faster

Let’s try and google about how to make your MariaDB server faster. Most of the articles are telling you to increase the buffer pool to 80 % percent of your RAM memory, to keep the database server separated, add indexes to your queries, use SSD and other tips.

IO scheduler

For optimal IO performance use noop scheduler. Recommended schedulers are noop and deadline. To check your scheduler use the following command:

cat /sys/block/${DEVICE}/queue/scheduler

The output should be like this:

cat /sys/block/sda/queue/scheduler
[noop] deadline cfq

Swapiness

Linux has a swappiness setting which determines the balance between swapping out pages (chunks of memory) from RAM to a preconfigured swap space on the hard drive.

The setting is from 0 to 100, with lower values meaning a lower likelihood of swapping. The default is usually 60 – you can check this by running:

sysctl vm.swappiness

A low swappiness setting is recommended for database workloads. For MariaDB databases, it is recommended to set swappiness to a value of 1.

vm.swappiness = 1

For other tips , check the official documentation: https://mariadb.com/kb/en/optimization-and-tuning/