Skip to content

Instantly share code, notes, and snippets.

@Lathanao
Last active January 10, 2024 15:54
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save Lathanao/35cc0384c7c8fc055814f8e28059d011 to your computer and use it in GitHub Desktop.
Save Lathanao/35cc0384c7c8fc055814f8e28059d011 to your computer and use it in GitHub Desktop.
Percona Server 8.0 configuration file
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
log-error = /var/log/mysql/error.log
server-id = 1
##############################################################################################
## Tunning Test SuperSet ##
##############################################################################################
performance_schema
performance_schema_events_waits_history_size=20
performance_schema_events_waits_history_long_size=15000
# Control the maximum size for the ibtmp1 file
innodb_temp_data_file_path = ibtmp1:64M:autoextend:max:20G
innodb_thread_concurrency = 0
innodb_read_io_threads = 64
innodb_write_io_threads = 64
##############################################################################################
## http://dev.mysql.com/doc/refman/5.6/en/innodb-parameters.html ##
## https://raw.githubusercontent.com/rackerhacker/MySQLTuner-perl/master/mysqltuner.pl ##
## https://launchpadlibrarian.net/78745738/tuning-primer.sh ##
## yum install mytop / apt-get install mytop ##
##############################################################################################
[mysqld]
innodb_flush_method = O_DIRECT
### MyISAM #
key_buffer_size = 256M # keep it low if no myisam data
myisam-recover-options = FORCE,BACKUP
[mysqlhotcopy]
interactive-timeout
### SAFETY #
innodb = force
max_allowed_packet = 250M
max_connect_errors = 100000
bind-address = 127.0.0.1
skip-name-resolve
skip-ssl
### UNSAFETY #
binlog_cache_size = 1M
skip-log-bin
early-plugin-load=""
no-auto-rehash
### CACHE #
sort_buffer_size = 2M
read_buffer_size = 2M
write_buffer_size = 2M
read_rnd_buffer_size = 2M
join_buffer_size = 2M
tmp_table_size = 128M
max_heap_table_size = 128M
max_connections = 2000
thread_pool_size = 16
open_files_limit = 65535
table_definition_cache = 4000
table_open_cache = 4000
[With no query cache :: recommanded if using Magento]
thread_cache_size = 32
query_cache_size = 128M
query_cache_type = 2
query_cache_limit = 4M
[With no query cache :: recommanded if using PrestaShop]
#thread_cache_size = 0
#query_cache_size = 0
#query_cache_type = 2
#query_cache_limit = 0
[innodb]
innodb_lock_wait_timeout = 30
innodb_flush_method = O_DIRECT
innodb_flush_log_at_trx_commit = 2
innodb_log_files_in_group = 2
innodb_log_file_size = 16M
innodb_log_buffer_size = 32M
innodb_file_per_table = 1
innodb_buffer_pool_instances = 4
innodb_buffer_pool_size = 6000M
innodb_open_files=2000
innodb_commit_concurrency=0
innodb_max_dirty_pages_pct = 80
# in emergency or troubleshooting situations, to get the absolute fastest shutdown if data is at risk of corruption.
Use innodb_fast_shutdown=2
### LOGGING #
log_error = /var/log/mysqld.log
log_queries_not_using_indexes = 1
log_slow_admin_statements = 1
slow_query_log = 1
long_query_time = 1
skip-log-bin
slow_query_log_file = /var/log/mysql-slow.log
### BINARY LOGGING #
#log_bin = /var/lib//mysql-bin.log
#expire_logs_days = 14
#sync_binlog = 1
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment