Skip to content

Instantly share code, notes, and snippets.

@benhartwich
Created May 9, 2018 10:59
Show Gist options
  • Save benhartwich/b0d78b916e0b812644dc3c31ee83c5c3 to your computer and use it in GitHub Desktop.
Save benhartwich/b0d78b916e0b812644dc3c31ee83c5c3 to your computer and use it in GitHub Desktop.
MariaDB Tuning
[mysqld]
connect_timeout = 15
wait_timeout = 120
max_allowed_packet = 16M
sort_buffer_size = 16M
bulk_insert_buffer_size = 16M
tmp_table_size = 32M
max_heap_table_size = 32M
thread_handling = pool-of-threads
#thread_pool_size = 128
join_buffer_size = 16M
join_cache_level = 2
aria_pagecache_buffer_size = 512M
aria_sort_buffer_size = 16M
concurrent_insert = 2
read_buffer_size = 2M
read_rnd_buffer_size = 1M
low_priority_updates = 1
key_buffer_size = 64M
open-files-limit = 4000
table_open_cache = 4000
thread_cache_size = 16K
thread_stack = 192K
myisam_recover = BACKUP
myisam_sort_buffer_size = 512M
query_cache_limit = 256K
query_cache_min_res_unit = 2k
query_cache_size = 32M
query_cache_type = 0
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
log_warnings = 2
slow_query_log=1
slow_query_log_file = /var/log/mysql/mariadb-slow.log
long_query_time = 10
log_slow_rate_limit = 1000
log_slow_verbosity = query_plan
log-queries-not-using-indexes
#log_slow_admin_statements
#log_bin = /var/log/mysql/mariadb-bin
#log_bin_index = /var/log/mysql/mariadb-bin.index
expire_logs_days = 10
max_binlog_size = 100M
innodb_log_file_size = 128M
innodb_buffer_pool_instances = 12
innodb_buffer_pool_size = 12G
innodb_log_buffer_size = 200M
innodb_file_per_table = 1
#innodb_open_files = 1000
innodb_io_capacity = 4000
innodb_read_io_threads = 64
innodb_thread_concurrency = 0
innodb_write_io_threads = 64
innodb_flush_method = O_DIRECT
#innodb_use_atomic_writes = 1
innodb_file_format = barracuda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment