[mysqld]
# 内存配置
innodb_buffer_pool_size = 24G          # 总内存的75%
innodb_buffer_pool_instances = 24      # 每个实例1GB
innodb_log_buffer_size = 256M

# 并发配置
innodb_thread_concurrency = 16         # 核心数
max_connections = 1000
innodb_read_io_threads = 8
innodb_write_io_threads = 8

# 日志配置
innodb_log_file_size = 2G              # 大日志文件减少checkpoint
innodb_log_files_in_group = 2
innodb_flush_log_at_trx_commit = 2     # 性能优先

# 缓冲配置
innodb_flush_method = O_DIRECT
innodb_doublewrite = 1
innodb_file_per_table = 1

# 查询缓存
query_cache_type = 1
query_cache_size = 256M

# 临时表
tmp_table_size = 256M
max_heap_table_size = 256M

# 连接配置
thread_cache_size = 100
table_open_cache = 4000

# 二进制日志(如果启用)
binlog_cache_size = 1M
max_binlog_cache_size = 2G