Skip to content

Contrib / RFC Fake PR : Bug#117740 - Counters for Slow InnoDB Sync Reads.#17

Draft
jfg956 wants to merge 1 commit into9.2.0_for_fake_prsfrom
9.2.0_bug117740_contrib_slow_innodb_sync_reads
Draft

Contrib / RFC Fake PR : Bug#117740 - Counters for Slow InnoDB Sync Reads.#17
jfg956 wants to merge 1 commit into9.2.0_for_fake_prsfrom
9.2.0_bug117740_contrib_slow_innodb_sync_reads

Conversation

@jfg956
Copy link
Owner

@jfg956 jfg956 commented Mar 18, 2025

This PR implements Counters for Slow InnoDB Sync Reads, partially fulfilling the feature request of Bug #117740 : Please consider adding Slow IO Counters. More about the reasons why this is needed in Bug #117740.

This is a "Contrib / RFC Fake PR". It is there so people can comment on this work in case it needs adjustments. This has been contributed on 2025-03-18 as a patch file in Bug #117740. More about Fake PR in a previous RFC blog post, section Fake PRs and my Way of Working on MySQL Contributions.

This PR merges on 9.2.0. Adapting it to 8.4 and 8.0 should be little work.

For implementing counters for Slow InnoDB Sync Reads, this PR introduces a new global variable : innodb_buffer_pool_read_sync_slow_io_threshold_usec. The default value is 1 hour, which should not trigger any increase of the slow counters. For monitoring slow InnoDB Sync Reads, this threshold should be set in such a way that the counters do not increase most of the time, and increase significantly when the IO subsystem is misbehaving (I cannot tell you exactly how to set this up because it will depend on your IO subsystem, but a value close to p99 of its IO latency might be good). Note that occasional increase of the counters should not be interpreted as a misbehaving IO subsystem because tail latencies will always happen.

The names of the InnoDB Metric of the four counters introduced by this PR, with the matching global status in parentheses, are :

  • buf_pool_reads_sync_io_count (innodb_buffer_pool_reads_sync_io_count);
  • buf_pool_reads_sync_io_wait_usec (innodb_buffer_pool_reads_sync_io_wait_usec);
  • buf_pool_reads_sync_io_slow_count (innodb_buffer_pool_reads_sync_io_slow_count);
  • buf_pool_reads_sync_io_slow_wait_usec (innodb_buffer_pool_reads_sync_io_slow_wait_usec).

The first two counters increase for all Sync Read IOs, and the last two only when the wait time of an IO is above the threshold.

I blogged about this in Contrib RFC: Counters for Slow InnoDB Sync Reads.

I think that this PR should not bring any significant performance degradation, but I am yet to fully validate this. I might do this in the next weeks / months and add details in the bug and in this PR. Also in the next weeks / months and if time allows, I might submit an improved version of this PR with tests, and with adjustment taking into account the feedback I might have received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant