Created
April 28, 2017 04:09
-
-
Save Gomah/0859312d94619469a2a2b27e715c964c to your computer and use it in GitHub Desktop.
MySQL config for 4 cores/8 threads, 32 GB RAM
This file contains 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 | |
[client] | |
port = 3306 | |
socket = /var/run/mysqld/mysqld.sock | |
# MYSQL SAFE | |
[mysqld_safe] | |
pid-file = /var/run/mysqld/mysqld.pid | |
socket = /var/run/mysqld/mysqld.sock | |
nice = 0 | |
[mysqld] | |
# GENERAL | |
user = mysql | |
default_storage_engine = InnoDB | |
pid-file = /var/run/mysqld/mysqld.pid | |
socket = /var/run/mysqld/mysqld.sock | |
port = 3306 | |
basedir = /usr | |
datadir = /var/lib/mysql | |
tmpdir = /tmp | |
lc-messages-dir = /usr/share/mysql | |
explicit_defaults_for_timestamp | |
# MyISAM | |
key_buffer_size = 32M | |
myisam_recover = FORCE,BACKUP | |
# SAFETY | |
innodb = FORCE | |
innodb_strict_mode = 1 | |
max_allowed_packet = 16M | |
max_connect_errors = 1000000 | |
skip_name_resolve | |
# BINARY LOGGING | |
log_bin = /var/log/mysql/mysql-bin | |
expire_logs_days = 14 | |
sync_binlog = 1 | |
# CACHES AND LIMITS | |
max_connections = 500 | |
max_heap_table_size = 32M | |
open_files_limit = 65535 | |
query_cache_type = 0 | |
query_cache_size = 0 | |
table_definition_cache = 4096 | |
table_open_cache = 10240 | |
thread_cache_size = 50 | |
tmp_table_size = 32M | |
# INNODB | |
innodb_buffer_pool_size = 26G | |
innodb_buffer_pool_instances = 4 | |
innodb_flush_method = O_DIRECT | |
innodb_flush_log_at_trx_commit = 1 | |
innodb_file_per_table = 1 | |
innodb_log_files_in_group = 2 | |
innodb_log_file_size = 512M | |
# LOGGING | |
log_error = /var/log/mysql/mysql-error.log | |
log_queries_not_using_indexes = 1 | |
slow_query_log = 1 | |
slow_query_log_file = /var/log/mysql/mysql-slow.log | |
# Disabling symbolic-links is recommended to prevent assorted security risks | |
symbolic-links = 0 |
M-Shahbaz
commented
Nov 16, 2021
•
Any recommendation MySQL 8 optimization for AlmaLinux v8 with 10 CPUs and 32 GB ram?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment