Bug #109208 Implement a counter for observing LRU flushing.
Submitted: 25 Nov 2022 18:19 Modified: 27 Nov 2022 8:39
Reporter: Jean-François Gagné Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[25 Nov 2022 18:19] Jean-François Gagné
Description:
Hi,

I did not find any counters allowing observing when LRU flushing is happening.  I consider this an important event to observe as this means dirty pages are reaching the tail of the LRU, which might be a warning sign that single page flush are about to happen, which might cause LRU contention.

Note that such counter is implemented since Percona Server 5.5.  Vadim is writing about this in [1] (innodb_buffer_pool_pages_LRU_flushed [2] global status).

[1]: https://www.percona.com/blog/2011/01/13/different-flavors-of-innodb-flushing/

[2]: https://docs.percona.com/percona-server/8.0/diagnostics/innodb_show_status.html#innodb_buf...

Also, it looks like this was partially implemented in MySQL.  Comparing MySQL and Percona Server code, I see that this feature in implemented with the buf_lru_flush_page_count variable incremented in [3].  This variable is present in MySQL code [4], but I do not find any place in the code where it is read.  In Percona Server, it looks exposed in [5].

[3]: https://github.com/percona/percona-server/blob/58161e3dee9904c501d29d3ad8305f4afd3015da/st...

[4]: https://github.com/mysql/mysql-server/blob/mysql-8.0.30/storage/innobase/buf/buf0flu.cc#L2...

[5]: https://github.com/percona/percona-server/blob/58161e3dee9904c501d29d3ad8305f4afd3015da/st...

Note that I am not attached to a status variable for exposing this counter.  An InnoDB Metric would do.

Many thanks for considering this,

Jean-François Gagné

How to repeat:
N/A because feature request.
[25 Nov 2022 18:22] Jean-François Gagné
Fixing a typo in title...

was: Implement a counter for observering LRU flushing.

now: Implement a counter for observing LRU flushing.
[27 Nov 2022 8:39] MySQL Verification Team
Hello Jean-François,

Thank you for the feature request!

regards,
Umesh