Skip to content

Instantly share code, notes, and snippets.

@nilreml
Last active March 10, 2024 11:15
Show Gist options
  • Save nilreml/376bcc0b213478a7a9877c49bca2932c to your computer and use it in GitHub Desktop.
Save nilreml/376bcc0b213478a7a9877c49bca2932c to your computer and use it in GitHub Desktop.
NOTE: make sure you understand each option's implications before applying any of this
[mysqld]
# general
max_connections=4000
table_open_cache=8000
table_open_cache_instances=16
max_prepared_stmt_count=512000
back_log=1500
default_password_lifetime=0
default_authentication_plugin=mysql_native_password
character_set_server=latin1
collation_server=latin1_swedish_ci
skip-character-set-client-handshake
ssl=0
performance_schema=OFF
skip_log_bin=1
transaction_isolation=REPEATABLE-READ
# files
innodb_file_per_table
innodb_log_file_size=1024M
innodb_log_files_in_group=32
innodb_open_files=4000
# buffers
innodb_buffer_pool_size=128000M
innodb_buffer_pool_instances=16
innodb_log_buffer_size=64M
# tune
innodb_doublewrite=0
innodb_thread_concurrency=0
innodb_flush_log_at_trx_commit=1
innodb_max_dirty_pages_pct=90
innodb_max_dirty_pages_pct_lwm=10
join_buffer_size=32K
sort_buffer_size=32K
innodb_use_native_aio=1
innodb_stats_persistent=1
innodb_spin_wait_delay=6
innodb_max_purge_lag_delay=300000
innodb_max_purge_lag=0
innodb_flush_method=O_DIRECT
innodb_checksum_algorithm=none
innodb_io_capacity=10000
innodb_io_capacity_max=40000
innodb_lru_scan_depth=9000
innodb_change_buffering=none
innodb_read_only=0
innodb_page_cleaners=16
innodb_undo_log_truncate=off
# perf special
innodb_adaptive_flushing=1
innodb_flush_neighbors=0
innodb_read_io_threads=16
innodb_write_io_threads=16
innodb_purge_threads=4
innodb_adaptive_hash_index=0
# monitoring
innodb_monitor_enable='%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment