Mysql Myisam引擎相关参数优化

key_buffer_size

mysql> show status like 'key%';
+------------------------+------------+
| Variable_name | Value |
+------------------------+------------+
| Key_blocks_not_flushed | 0 |
| Key_blocks_unused | 792 |
| Key_blocks_used | 1714736 |
| Key_read_requests | 1067141109 |
| Key_reads | 5899443 |
| Key_write_requests | 168658982 |
| Key_writes | 9229656 |
+------------------------+------------+
7 rows in set (0.00 sec)

观察 key_reads/Key_read_requests  比例 ,比例过高则需要增加key_buffer_size

观察 Key_blocks_unused ,较少时需要增加key_buffer_size 

set global  key_buffer_size=4*1024*1024*1024 在线修改key_buffer_size

/etc/my.cnf 修改 key_buffer_size = 4G  之后重启

 

innodb优化 https://blog.csdn.net/shiyong1949/article/details/75074190

你可能感兴趣的:(LINUX,MYSQL)