How to calculate amount of work performed by the page cleaner thread each second?

荒凉一梦 提交于 2020-01-06 05:22:12

问题


I try to tune InnoDB Buffer Pool Flushing parameters.

In MySQL 5.7 manual

  • innodb_lru_scan_depth * innodb_buffer_pool_instances = amount of work performed by the page cleaner thread each second

My question is : How can I calculate the amount of work performed by the page cleaner thread each second?


回答1:


Run the SQL command:

SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_pages_flushed'

Once every second. Compare the value to the previous second.

The difference of that value from one second to the next is the number of dirty pages the page cleaner requested to flush to disk.

Example:

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 |
+----------------------------------+-----------+

So in the moment I waited, the page cleaner flushed 556 pages.

The upper limit of this work is a complex calculation, involving several InnoDB configuration options. Read my answer to How to solve mysql warning: "InnoDB: page_cleaner: 1000ms intended loop took XXX ms. The settings might not be optimal "? for a description of how it works.



来源:https://stackoverflow.com/questions/51760711/how-to-calculate-amount-of-work-performed-by-the-page-cleaner-thread-each-second

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!