调优
1)优化语句(可能一台服务器上存在多个实例,多个实例都得做参数优化)
cat updatepm.sh
echo `ps -ef|grep 8802|grep mysqld|grep sock|awk '{print $(NF-1)}'|awk -F '=' '{print $2}'`
mysql -S /app/teledb/39/socket_8802/mysql_8802.sock -uroot -e "set global innodb_thread_concurrency=128;"
sudo mysql -S /app/teledb/teledb/teledb_951450244879483904/socket_8801/mysql_8801.sock -h IP -P 8801 -uroot -p -e"set global innodb_buffer_pool_size=96636764160;set global innodb_thread_concurrency=48;set global thread_pool_size=64;set global thread_pool_stall_limit=100;set global thread_pool_oversubscribe=5;"
上面的缓冲池大小为90G,可根据主机内存实际情况调整 (free -m 查看内存),上面语句中的部署路径、端口、ip需根据部署实际情况调整
(1)/app/teledb/teledb/teledb_955187092961362944/mysql_8801/etc/mysql8801.cnf
set global innodb_buffer_pool_size=96636764160;
set global innodb_thread_concurrency=48;
set global thread_pool_size=64;
set global thread_pool_stall_limit=100;
set global thread_pool_oversubscribe=5;
2)优化后查看参数情况:
mysql -S /app/teledb/teledb/teledb_951450244879483904/socket_8801/mysql_8801.sock -uroot -p
mysql -hIP -P 8801 -uroot -p -e
"show variables like '%buffer_pool_size%';
show variables like '%innodb_thread_concurrency%';
show variables like '%thread_pool_size%';
show variables like '%thread_pool_stall_limit%';
show variables like 'thread_pool_oversubscribe%';"