Skip to content

Conversation

jmrenouard
Copy link
Collaborator

This commit implements a more intelligent recommendation for the innodb_redo_log_capacity variable for MySQL versions 8.0.30 and newer.

The previous recommendation was based on a simple percentage of the innodb_buffer_pool_size, which was often inaccurate. The new logic calculates the hourly InnoDB log write rate based on the Innodb_os_log_written status variable and the server's uptime. It then suggests a value for innodb_redo_log_capacity that can hold at least one hour's worth of writes, rounded up to a practical power-of-2 GB value.

A sanity check is also included to prevent recommending an excessively large redo log compared to the total size of the InnoDB data.

For older MySQL and MariaDB versions, the existing logic for innodb_log_file_size and innodb_log_files_in_group is preserved.

A new helper function hr_bytes_practical_rnd has been added to handle the rounding of the suggested size.

Fixes #784

This commit implements a more intelligent recommendation for the
`innodb_redo_log_capacity` variable for MySQL versions 8.0.30 and newer.

The previous recommendation was based on a simple percentage of the
`innodb_buffer_pool_size`, which was often inaccurate. The new logic
calculates the hourly InnoDB log write rate based on the
`Innodb_os_log_written` status variable and the server's uptime. It then
suggests a value for `innodb_redo_log_capacity` that can hold at least
one hour's worth of writes, rounded up to a practical power-of-2 GB
value.

A sanity check is also included to prevent recommending an excessively
large redo log compared to the total size of the InnoDB data.

For older MySQL and MariaDB versions, the existing logic for
`innodb_log_file_size` and `innodb_log_files_in_group` is preserved.

A new helper function `hr_bytes_practical_rnd` has been added to handle
the rounding of the suggested size.

Fixes major#784
@jmrenouard jmrenouard merged commit 71f1509 into major:master Aug 29, 2025
4 checks passed
devenbj added a commit to devenbj/MySQLTuner-perl that referenced this pull request Aug 31, 2025
Fixes reporting issues with innodb_redo_log_capacity on MariaDB, where it does not exist.

Regression from pull request major#849.
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.

[RFC] Update innodb_log_file_size/innodb_redo_log_capacity recommendation
1 participant