-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
The InnoDB log buffer size increase recommendation is confusing.
Tuner version (extract):
$ ./mysqltuner.pl --help
Name:
MySQLTuner 1.8.2 - MySQL High Performance Tuning Script
Tuner recommendation (extract):
./mysqltuner.pl --host {host} --user {user} --pass {pass} --forcemem 65536 --buffers
-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB Buffers
[--] +-- InnoDB Log Buffer: 8.0M
-------- Recommendations ---------------------------------------------------------------------------
Variables to adjust:
innodb_log_buffer_size (>= 8M)
The log buffer size is already 8M :)
I had a look at the source code:
if ( defined $mystat{'Innodb_log_waits'}
&& $mystat{'Innodb_log_waits'} > 0 )
{
badprint "InnoDB log waits: "
. percentage( $mystat{'Innodb_log_waits'},
$mystat{'Innodb_log_writes'} )
. "% ("
. $mystat{'Innodb_log_waits'}
. " waits / "
. $mystat{'Innodb_log_writes'}
. " writes)";
push( @adjvars,
"innodb_log_buffer_size (>= "
. hr_bytes_rnd( $myvar{'innodb_log_buffer_size'} )
. ")" );
}
The intention of the logic is that, if log waits are found, the buffer should be increased, regardless of its actual size.
However, the message shows a >=
operator (innodb_log_buffer_size (>= 8M)
), which is confusing; as a matter of fact, when I saw this result, I thought (before looking at the source) that there was an off-by-one or rounding error in the code.
The >
operator conveys correctly the message of strictly increasing the buffer:
Variables to adjust:
innodb_log_buffer_size (> 8M)
As as first fix, the operator should be corrected. I'm creating separately an issue about the threshold, which is in my opinion too strict.