my.cnf
[mysqld]
innodb_buffer_pool_size = 4G
innodb_buffer_pool_instances = 4
innodb_log_file_size = 512M
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT
# Thread pool (MariaDB-specific)
thread_handling = pool-of-threads
thread_pool_size = 32
# Query cache
query_cache_type = 1
query_cache_size = 64M
max_connections = 500
tmp_table_size = 128M
max_heap_table_size = 128M
slow_query_log = 1
long_query_time = 0.5
Restart
systemctl restart mariadb 2>/dev/null || rc-service mariadb restart 2>/dev/null || rcctl restart mysqld
MySQLTuner
curl -Lo mysqltuner.pl https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl
perl mysqltuner.pl --user root --pass RootPass!