innodb buffer pool 刷新快慢取决于两个参数
mysql> show variables like 'innodb_io_capacity%';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| innodb_io_capacity | 200 |
| innodb_io_capacity_max | 2000 |
+------------------------+-------+
2 rows in set (0.01 sec)
mysql> show variables like 'innodb_max_dirty_pages_pct%';
+--------------------------------+-------+
| Variable_name | Value |
+--------------------------------+-------+
| innodb_max_dirty_pages_pct | 75 |
| innodb_max_dirty_pages_pct_lwm | 0 |
+--------------------------------+-------+
2 rows in set (0.00 sec)
innodb_max_dirty_pages_pct 控制缓存吃中脏页最大比例 默认值75%,如果达到或者超出,innodb后台线程将开始缓存刷新
innodb_io_capacity 代表磁盘系统IO能力。一定程度上代表磁盘每秒可以完成I/O的次数,默认200,转速较低的磁盘,可将innodb_io_capacity 降低到100 对于固态硬盘和多个磁盘组成的盘阵,可适当增大