JezK
Edit File: my.cnf
# Optimized MySQL 8 by SH Team [client] default-character-set=utf8mb4 [mysql] port = 3306 socket = /var/lib/mysql/mysql.sock default-character-set=utf8mb4 [mysqld] # --- General & Compatibility --- # Modify performance-schema=ON if you need to troubleshoot MySQL Overload performance-schema=0 innodb_use_native_aio = 1 disable-log-bin = 1 skip_log_bin #default-authentication-plugin = mysql_native_password bind_address = 127.0.0.1 datadir = /var/lib/mysql #max_allowed_packet = 256M #max_connect_errors = 1000000 pid_file = /var/lib/mysql/mysql.pid port = 3306 skip_external_locking socket = /var/lib/mysql/mysql.sock tmpdir = /tmp user = mysql event_scheduler = off sql_mode="" # --- MySQL 8.4 Authentication Compatibility --- default_authentication_plugin = mysql_native_password # # --- Charset --- character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci # This forces MySQL to use the modern, large-index format for all new tables innodb_default_row_format = DYNAMIC # --- Networking & Limits --- max_allowed_packet = 256M max_connect_errors = 1000000 max_connections = 1200 # Balanced limit for 400 accounts max_user_connections = 50 # Protects server from a single bad account back_log = 512 thread_cache_size = 100 thread_stack = 256K interactive_timeout = 60 # Lowered to drop dead connections faster wait_timeout = 60 # Lowered to drop dead connections faster max_execution_time = 60000 # Measured in milliseconds in newer versions (60s) # --- Memory & Buffers per Connection (Sane defaults to prevent OOM) --- sort_buffer_size = 2M join_buffer_size = 2M read_buffer_size = 1M read_rnd_buffer_size = 1M # --- Storage Engine Configurations (Global Pools) --- default_storage_engine = InnoDB innodb_buffer_pool_instances = 16 # Optimized for higher core counts innodb_buffer_pool_size = 48G # Leverages your 192GB RAM responsibly innodb_file_per_table = 1 innodb_flush_log_at_trx_commit = 2 # Sane compromise: massive speed up, safe against app crashes innodb_flush_method = O_DIRECT innodb_log_buffer_size = 64M # --- Redo Log Architecture (MySQL 8.4 compliant) --- #innodb_redo_log_capacity = 4G # Replaces deprecated log_file_size innodb_log_file_size = 2G # Set perfectly for a 48G buffer pool on 8.0 # --- Threading & I/O Real Estate --- innodb_stats_on_metadata = 0 innodb_thread_concurrency = 0 # 0 allows MySQL to dynamically scale across your 72 CPU threads innodb_read_io_threads = 16 innodb_write_io_threads = 16 # --- Legacy MyISAM Tuning --- key_buffer_size = 128M # Reduced. InnoDB is the standard. low_priority_updates = 1 concurrent_insert = 2 # --- Caches & Open Files --- table_definition_cache = 40000 open_files_limit = 100000 max_heap_table_size = 64M tmp_table_size = 64M ft_min_word_len = 3 # --- Logging --- log_error = /var/lib/mysql/mysql_error.log log_queries_not_using_indexes = 0 # Turn off on production shared hosting to prevent massive log I/O overhead long_query_time = 5 slow_query_log = 1 # Enable to track down bad user scripts slow_query_log_file = /var/lib/mysql/mysql_slow.log mysqlx = 0 [mysqldump] quick quote_names max_allowed_packet = 1G