[mysqld] # 连接和线程管理 max_connections = 2048 thread_cache_size = 512 interactive_timeout = 30 wait_timeout = 30 # InnoDB设置 innodb_buffer_pool_size = 2048M innodb_buffer_pool_instances = 2 innodb_log_buffer_size = 16M innodb_log_file_size = 64M innodb_lock_wait_timeout = 30 innodb_file_per_table = 1 innodb_flush_log_at_trx_commit = 1 innodb_io_capacity = 1000 innodb_io_capacity_max = 2000 # 缓存和限制 table_open_cache = 2000 open_files_limit = 4000 tmp_table_size = 16M max_heap_table_size = 16M max_allowed_packet = 16M # 缓冲区大小 sort_buffer_size = 4M read_buffer_size = 2M join_buffer_size = 2M # --------------------------