1. 更改MySQL Data File位置

datadir=/data/mysql
socket=/data/mysql/mysql.sock

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

2. 调整OS参数

* soft nproc 10240
* hard nproc 10240
* soft nofile 102400
* hard nofile 102400
* soft stack 10240
* hard stack 10240

3. 调整MySQL参数

innodb_buffer_pool_size = 300G # (adjust value here, 50%-70% of total RAM)
innodb_log_file_size = 256M
innodb_flush_log_at_trx_commit = 1 # may change to 2 or 0
innodb_flush_method = O_DIRECT
max_connections=10240
max_connect_errors=100000
open_files_limit=102400

4. 客户端配置调整

[client]
port=3306
socket=/data/mysql/mysql.sock

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄