Skip to content

Instantly share code, notes, and snippets.

@carusyte
Last active March 19, 2020 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carusyte/eb96de5b3e8979b4a86594fcb15f00ac to your computer and use it in GitHub Desktop.
Save carusyte/eb96de5b3e8979b4a86594fcb15f00ac to your computer and use it in GitHub Desktop.
A sample of tuned MySQL configuration based on Alienware Area51m model, i9, 8CPU/16 Threads, 64G RAM, 1T nvme
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html
[mysqld]
wait_timeout = 28800
interactive_timeout = 28800
max_allowed_packet=256M
max_connections=1024
innodb_flush_method = O_DIRECT
innodb_page_size = 4096
innodb_io_capacity = 5000
innodb_io_capacity_max = 8000
innodb_file_per_table = ON
innodb_log_compressed_pages = OFF
innodb_parallel_read_threads = 256
innodb_read_io_threads = 64
innodb_write_io_threads = 64
innodb_concurrency_tickets = 3000000000
innodb_buffer_pool_dump_pct = 80
# 32M
innodb_fsync_threshold = 33554432
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 32G
innodb_buffer_pool_instances = 8
# https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_flush_neighbors
#innodb-flush-neighbors = 1
innodb_max_dirty_pages_pct_lwm = 5
innodb_max_dirty_pages_pct = 10
#innodb_lru_scan_depth = 16384
innodb_lru_scan_depth = 524288
tmp_table_size = 8G
max_heap_table_size = 8G
bulk_insert_buffer_size = 2G
#innodb_directories = /home/mysql
#System tablespace
innodb_data_home_dir = /home/mysql/datafile/
innodb_data_file_path=ibdata1:1488977920;ibdata2:512M;ibdata3:512M;ibdata4:512M;ibdata5:512M;ibdata6:512M;ibdata7:512M;ibdata8:512M:autoextend
#Redo log setting
innodb_log_buffer_size = 8G
innodb_log_file_size = 512M
innodb_log_files_in_group = 16
innodb_log_group_home_dir = /home/mysql/datafile
#Undo log setting
innodb_undo_directory = /home/mysql/datafile
#ACID transaction setting
innodb_flush_log_at_trx_commit = 2
#innodb_flush_log_at_timeout = 2
innodb_doublewrite = OFF
sync_binlog = 0
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
disable-log-bin
binlog_row_image = minimal
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
# Remove leading # to revert to previous value for default_authentication_plugin,
# this will increase compatibility with older clients. For background, see:
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin
# default-authentication-plugin=mysql_native_password
skip-host-cache
skip-name-resolve
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
secure-file-priv=/var/lib/mysql-files
user=mysql
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
secure_file_priv=""
pid-file=/var/run/mysqld/mysqld.pid
long_query_time = 2
#log_queries_not_using_indexes = ON
log_slow_extra = ON
slow_query_log = OFF
#min_examined_row_limit = 1000
#slow_query_log_file = slow_query.log
#log_output = /var/lib/mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment