When it comes to optimizing the performance of a database, DBAs have to look at everything from the OS to the network. In this session, MariaDB Enterprise Architect Manjot Singh shares best practices for getting the most out of MariaDB. He highlights recommended OS settings, important configuration and tuning parameters, options for improving replication and clustering performance and features such as query result caching.
8. Operating System
System
# sysctl -w vm.swappiness=1
# echo "vm.swappiness=1" >> /etc/sysctl.conf
# echo noop > /sys/block/sda/queue/scheduler
9. Operating System
System
# cat /etc/security/limits.conf
mysql soft nofile 65535
mysql hard nofile 65535
# cat /etc/fstab
... rw,noatime,nodiratime,data=writeback ...
11. Server Variables
MariaDB Server
max_allowed_packet = e.g. 128G-256G
thread_handling = pool-of-threads
thread_pool_size = # of cpu cores
thread_pool_max_threads = 65536
thread_pool_min_threads = e.g. 8
thread_pool_idle_timeout = 60
max_connections = e.g. 2000-10000
12. Server Variables
MariaDB Server query_cache_size = 0
query_cache_type = 0
skip_name_resolv = ON
thread_cache_size = DON'T SET (Auto)
sync_binlog = e.g. 1000
25. MyRocks
Writes and Compression
Storage
Engines
SET session sql_log_bin=0;
SET session rocksdb_bulk_load_allow_unsorted=1;
SET session rocksdb_bulk_load=1;
SET session rocksdb_commit_in_the_middle=1;
...
SET session rocksdb_bulk_load=0;
SET session rocksdb_bulk_load_allow_unsorted=0;