Speed / tune your system.
Posted: Tue 25. Oct 2022, 18:12
Hi all,
As you may or may not know, MariaDB has a big impact on the speed of your system and how fast websites respond.
My VPS has 2GB ram, and without tuning MariaDB (Mysql = same) it can make a difference between crawling or go as lightning.
The key here is in /etc/mysql/mariadb.conf.d/50-server.cnf and a few settings. I know this from a long time ago when I was running a 512MB server with millions of users and database that was several GB's in size.
Yes it works, yes it can be done.
In the file you find a few settings that handle this, if you don't adjust them the result is bad, and lot of unused memory to burn and a slow system.
Or on a low memory system, it burns memory and starts swapping, result is just as worse.
Unrem keybuffer, make it at least 25% of the size of your database, if you have plenty memory, 100% of the size. As this buffer stores parts or the whole database in memory (for reading). More is fast, but beware it doesn't start to swap, that is bad.
Second, thread_stack, unrem it, and anywhere between 128K to 256K should be fine.
Third, thread_cache_size, 8 to 16 usually works.
Forth, table_cache, 64 to 128 is often enough.
And last, query_cache_size, 16M is enough for most unless you have a lot of repeating queries, then a higher number is needed.
I'm not saying this will work for everybody, but on small systems where memory is key, this will help. On systems with loads of memory, often the memory isn't used properly and large database will suffer.
These are the few, of many parameters, the impact of these few is huge.
Enjoy.
Bas..
As you may or may not know, MariaDB has a big impact on the speed of your system and how fast websites respond.
My VPS has 2GB ram, and without tuning MariaDB (Mysql = same) it can make a difference between crawling or go as lightning.
The key here is in /etc/mysql/mariadb.conf.d/50-server.cnf and a few settings. I know this from a long time ago when I was running a 512MB server with millions of users and database that was several GB's in size.
Yes it works, yes it can be done.
In the file you find a few settings that handle this, if you don't adjust them the result is bad, and lot of unused memory to burn and a slow system.
Or on a low memory system, it burns memory and starts swapping, result is just as worse.
Unrem keybuffer, make it at least 25% of the size of your database, if you have plenty memory, 100% of the size. As this buffer stores parts or the whole database in memory (for reading). More is fast, but beware it doesn't start to swap, that is bad.
Second, thread_stack, unrem it, and anywhere between 128K to 256K should be fine.
Third, thread_cache_size, 8 to 16 usually works.
Forth, table_cache, 64 to 128 is often enough.
And last, query_cache_size, 16M is enough for most unless you have a lot of repeating queries, then a higher number is needed.
I'm not saying this will work for everybody, but on small systems where memory is key, this will help. On systems with loads of memory, often the memory isn't used properly and large database will suffer.
These are the few, of many parameters, the impact of these few is huge.
Enjoy.
Bas..