Last active
April 24, 2023 11:26
-
-
Save zevilz/d0ef33ebe3d03019f1bb338d1ac13620 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[client-server] | |
port = 3306 | |
socket = /run/mysqld/mysqld.sock | |
[client] | |
[mysqld] | |
user = mysql | |
pid-file = /run/mysqld/mysqld.pid | |
basedir = /usr | |
datadir = /var/lib/mysql | |
tmpdir = /tmp | |
lc_messages_dir = /usr/share/mysql | |
lc_messages = en_US | |
skip-external-locking | |
skip-name-resolve | |
performance_schema | |
bind-address = 127.0.0.1 | |
character-set-server = utf8mb4 | |
collation-server = utf8mb4_general_ci | |
# Main | |
max_connections = 250 # change if many connections errors | |
connect_timeout = 5 | |
wait_timeout = 600 | |
max_allowed_packet = 64M | |
thread_cache_size = 250 # same as max_connections | |
key_buffer_size = 2048M # 1Gb=128M 2Gb=256M 4Gb=512M 8Gb=1024M 16Gb=2048M 32Gb=4096M | |
join_buffer_size = 4M | |
sort_buffer_size = 4M | |
bulk_insert_buffer_size = 16M | |
tmp_table_size = 2048M # 1Gb=128M 2Gb=256M 4Gb=512M 8Gb=1024M 16Gb=2048M 32Gb=4096M | |
max_heap_table_size = 2048M # 1Gb=128M 2Gb=256M 4Gb=512M 8Gb=1024M 16Gb=2048M 32Gb=4096M | |
table_open_cache = 4096 | |
table_definition_cache = 800 | |
# Query Cache | |
query_cache_type = 1 | |
query_cache_limit = 2M | |
query_cache_size = 32M | |
# Logging | |
log_warnings = 2 | |
slow_query_log_file = /var/log/mysql/mariadb-slow.log | |
long_query_time = 3 | |
log_slow_verbosity = query_plan | |
#log_bin = /var/log/mysql/mariadb-bin | |
#log_bin_index = /var/log/mysql/mariadb-bin.index | |
#expire_logs_days = 10 | |
#max_binlog_size = 100M | |
#general_log | |
#general_log_file = /var/log/mysql/mysql_query.log | |
#log_error = /var/log/mysql/mysql_error.log | |
# InnoDB | |
default_storage_engine = InnoDB | |
innodb_log_file_size = 96M # 1Gb=16M 2Gb=64M >=4Gb=96M (25% from innodb_buffer_pool_size) | |
innodb_buffer_pool_size = 768M # 1Gb=128M 2Gb=512M >=4Gb=768M | |
innodb_log_buffer_size = 8M | |
innodb_file_per_table = 1 | |
innodb_open_files = 400 | |
innodb_io_capacity = 400 | |
innodb_flush_method = O_DIRECT | |
innodb_flush_log_at_trx_commit = 2 | |
innodb_buffer_pool_instances = 1 | |
[mysqld_safe] | |
nice = 0 | |
skip_log_error | |
syslog | |
[mysqldump] | |
quick | |
quote-names | |
max_allowed_packet = 64M | |
[isamchk] | |
key_buffer = 16M | |
!includedir /etc/mysql/conf.d/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment