Guidance on tuning Linux kernel settings for MariaDB performance, including I/O schedulers (using `none` or `mq-deadline`), open file limits, and core file sizes.
For optimal IO performance running a database on modern hardware we recommend using the none (previously called noop) scheduler.
Recommended schedulers are none, for SSDs and NVMes, and mq-deadline (previously called deadline) for hard disks.
You can check your scheduler setting with:
For instance, it should look like this output:
Older kernels may look like:
Writing the new scheduler name to the same /sys node will change the scheduler:
The impact of schedulers depend significantly on workload and hardware. You can measure the IO-latency using the bcc-tools script with an aim to keep the mean as low as possible.
By default, the system limits how many open file descriptors a process can have open at one time. It has both a soft and hard limit. On many systems, both the soft and hard limit default to 1024. On an active database server, it is very easy to exceed 1024 open file descriptors. Therefore, you may need to increase the soft and hard limits. There are a few ways to do so.
If you are using to start mysqld, then see the instructions at .
If you are using to start mysqld, then see the instructions at .
Otherwise, you can set the soft and hard limits for the mysql user account by adding the following lines to :
After the system is rebooted, the mysql user should use the new limits, and the user's ulimit output should look like the following:
By default, the system limits the size of core files that could be created. It has both a soft and hard limit. On many systems, the soft limit defaults to 0. If you want to , then you may need to increase this. Therefore, you may need to increase the soft and hard limits. There are a few ways to do so.
If you are using to start mysqld, then see the instructions at .
If you are using to start mysqld, then see the instructions at .
Otherwise, you can set the soft and hard limits for the mysql user account by adding the following lines to :
After the system is rebooted, the mysql user should use the new limits, and the user's ulimit output should look like the following:
See .
This page is licensed: CC BY-SA / Gnu FDL
cat /sys/block/${DEVICE}/queue/schedulercat /sys/block/vdb/queue/scheduler
[none] mq-deadline kyber bfqcat /sys/block/sda/queue/scheduler
[noop] deadline cfqecho noop > /sys/block/vdb/queue/schedulermysql soft nofile 65535
mysql hard nofile 65535$ ulimit -Sn
65535
$ ulimit -Hn
65535mysql soft core unlimited
mysql hard core unlimited$ ulimit -Sc
unlimited
$ ulimit -Hc
unlimited