[mysqld] # === Required Settings === pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock log-error = /var/log/mysql/error.log datadir = /home/mysql/ character-set-server = utf8mb4 collation-server = utf8mb4_general_ci init-connect = 'SET NAMES utf8mb4' thread_cache_size = 32 table_open_cache = 2048 sort_buffer_size = 8M # === InnoDB Settings === innodb_file_per_table innodb = force innodb_buffer_pool_instances = 16 innodb_buffer_pool_size = 28G innodb_file_per_table = 1 innodb_sort_buffer_size = 16M innodb_flush_log_at_trx_commit = 2 innodb_log_file_size = 2GB innodb_stats_on_metadata = OFF innodb_buffer_pool_instances = 8 innodb_io_capacity = 3000 innodb_io_capacity_max = 6000 innodb_read_io_threads = 16 innodb_write_io_threads = 16 innodb_log_buffer_size = 10M innodb_flush_method = O_DIRECT innodb_log_buffer_size = 64M innodb_thread_concurrency = 32 # === Connection Settings === max_connections = 2000 # Increased for high traffic back_log = 1000 # Increased for high traffic thread_cache_size = 200 # Increased for better thread handling thread_stack = 256K interactive_timeout = 300 # Increased timeout wait_timeout = 300 # Increased timeout # === Buffer Settings === join_buffer_size = 8M # Increased for better JOIN performance read_buffer_size = 4M # Increased for better read performance read_rnd_buffer_size = 8M # Increased for better random read performance sort_buffer_size = 8M # Increased for better sorting performance # === Table Settings === table_definition_cache = 60000 # Increased for more concurrent tables table_open_cache = 60000 # Increased for more concurrent tables open_files_limit = 100000 # Increased accordingly max_heap_table_size = 512M # Increased for better temp table handling tmp_table_size = 512M # Increased for better temp table handling # === Query Cache Settings === query_cache_size = 0 query_cache_type = 0 # === Logging Settings === slow_query_log = 1 slow_query_log_file = /var/lib/mysql/mysql_slow.log long_query_time = 2 # Log queries slower than 2 seconds log_queries_not_using_indexes = 0 # === Binary Logging === disable_log_bin