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

前端 未结 1 1237
夕颜
夕颜 2021-01-27 07:30

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
相关标签:
1条回答
  • 2021-01-27 08:01

    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.

    0 讨论(0)
提交回复
热议问题