如何计算页面清洁器线程每秒执行的工作量?

时间:2018-08-09 07:03:03

标签: mysql innodb mysql-5.7

我尝试调整InnoDB缓冲池刷新参数。

In MySQL 5.7 manual

  • innodb_lru_scan_depth * innodb_buffer_pool_instances =页面清洁器线程每秒执行的工作量

我的问题是:如何计算页面清洁器线程每秒执行的工作量?

1 个答案:

答案 0 :(得分:0)

运行SQL命令:

SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_pages_flushed'

每秒一次。将该值与前一秒进行比较。

该值从一秒到下一秒的差是页面清洁器请求刷新到磁盘的脏页面数。

示例:

mysql> SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_pages_flushed';
+----------------------------------+-----------+
| Variable_name                    | Value     |
+----------------------------------+-----------+
| Innodb_buffer_pool_pages_flushed | 496786650 |
+----------------------------------+-----------+

...wait a moment...

mysql> SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_pages_flushed';
+----------------------------------+-----------+
| Variable_name                    | Value     |
+----------------------------------+-----------+
| Innodb_buffer_pool_pages_flushed | 496787206 |
+----------------------------------+-----------+

因此,在我等待的那一刻,页面清洁器刷新了556页。

这项工作的上限是一个复杂的计算,涉及多个InnoDB配置选项。阅读我对How to solve mysql warning: "InnoDB: page_cleaner: 1000ms intended loop took XXX ms. The settings might not be optimal "?的回答,以了解其工作原理。