mysql性能优化

# 如果系统总内存为128G,如果设置为100G以上,则容易出现内存溢出,out of memory,导致mysqld被系统重启,日志在/var/log/message中;90G最佳,设置为70到80G,则更安全
innodb_buffer_pool_size = 90G  

# 这两个参数在主库设置双1,但从库设置为双0性能最佳,极为重要的性能参数
innodb_flush_log_at_trx_commit   = 0
sync_binlog = 0

# 连接数限制
max_connections   = 10240
max_user_connections   = 4000

# 慢查询阈值,锁等待超时阈值
long_query_time    = 0.5
lock_wait_timeout   = 120
原文地址:https://www.cnblogs.com/igoodful/p/13450976.html