[mysqld]
# InnoDB - set to 60% of RAM = ~14GB
innodb_buffer_pool_size         = 14G
innodb_buffer_pool_instances    = 8
innodb_log_file_size            = 512M
innodb_log_buffer_size          = 64M
innodb_flush_method             = O_DIRECT
innodb_flush_log_at_trx_commit  = 2
innodb_file_per_table           = 1
innodb_read_io_threads          = 8
innodb_write_io_threads         = 8

# Query cache (MariaDB)
query_cache_type                = 1
query_cache_size                = 128M
query_cache_limit               = 4M

# Connections
max_connections                 = 300
max_connect_errors              = 10000
thread_cache_size               = 50
wait_timeout                    = 300
interactive_timeout             = 300

# MyISAM
key_buffer_size                 = 128M
myisam_sort_buffer_size         = 64M

# Temp tables
tmp_table_size                  = 256M
max_heap_table_size             = 256M

# Slow query log
slow_query_log                  = 1
slow_query_log_file             = /var/log/mysql/mysql-slow.log
long_query_time                 = 2

# Misc
open_files_limit                = 65535
table_open_cache                = 4000
table_definition_cache          = 2000
