Skip to content

Commit 9862179

Browse files
authored
Merge branch 'master' into master
2 parents 79522b2 + 1e0f2ef commit 9862179

File tree

1 file changed

+38
-34
lines changed

1 file changed

+38
-34
lines changed

mysqltuner.pl

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,12 @@ package main;
292292
my $end = ( $opt{nocolor} == 0 ) ? "\e[0m" : "";
293293

294294
if ( (not $is_win) and ($opt{noprettyicon} == 0) ) {
295-
$good = "";
296-
$bad = "";
297-
$info = "";
298-
$deb = "";
299-
$cmd = "⌨️($me)";
295+
$good = ( $opt{nocolor} == 0 ) ? "\e[0;32m✔\e[0m " : "";
296+
$bad = ( $opt{nocolor} == 0 ) ? "\e[0;31m✘\e[0m " : "";
297+
$info = ( $opt{nocolor} == 0 ) ? "\e[0;34mℹ\e[0m " : "";
298+
$deb = ( $opt{nocolor} == 0 ) ? "\e[0;31m⚙\e[0m " : "";
299+
$cmd = ( $opt{nocolor} == 0 ) ? "\e[1;32m⌨️($me)" : "⌨️($me)";
300+
$end = ( $opt{nocolor} == 0 ) ? "\e[0m " : " ";
300301
}
301302
# Maximum lines of log output to read from end
302303
my $maxlines = 30000;
@@ -6663,37 +6664,40 @@ sub mysql_innodb {
66636664
}
66646665

66656666
# InnoDB Used Buffer Pool Size vs CHUNK size
6666-
if ( !defined( $myvar{'innodb_buffer_pool_chunk_size'} ) ) {
6667-
infoprint
6668-
"InnoDB Buffer Pool Chunk Size not used or defined in your version";
6669-
}
6670-
else {
6671-
infoprint "Number of InnoDB Buffer Pool Chunk: "
6672-
. int( $myvar{'innodb_buffer_pool_size'} ) /
6673-
int( $myvar{'innodb_buffer_pool_chunk_size'} ) . " for "
6674-
. $myvar{'innodb_buffer_pool_instances'}
6675-
. " Buffer Pool Instance(s)";
6676-
6677-
if (
6678-
int( $myvar{'innodb_buffer_pool_size'} ) % (
6679-
int( $myvar{'innodb_buffer_pool_chunk_size'} ) *
6680-
int( $myvar{'innodb_buffer_pool_instances'} )
6681-
) eq 0
6682-
)
6683-
{
6684-
goodprint
6685-
"Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances";
6686-
}
6687-
else {
6688-
badprint
6689-
"Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances";
6667+
if ( !defined($myvar{'innodb_buffer_pool_chunk_size'}) ||
6668+
$myvar{'innodb_buffer_pool_chunk_size'} == 0 ||
6669+
!defined($myvar{'innodb_buffer_pool_size'}) ||
6670+
$myvar{'innodb_buffer_pool_size'} == 0 ||
6671+
!defined($myvar{'innodb_buffer_pool_instances'}) ||
6672+
$myvar{'innodb_buffer_pool_instances'} == 0 ) {
6673+
6674+
badprint "Cannot calculate InnoDB Buffer Pool Chunk breakdown due to missing or zero values:";
6675+
6676+
infoprint " - innodb_buffer_pool_size: " .
6677+
(defined $myvar{'innodb_buffer_pool_size'} ? $myvar{'innodb_buffer_pool_size'} : "undefined");
6678+
infoprint " - innodb_buffer_pool_chunk_size: " .
6679+
(defined $myvar{'innodb_buffer_pool_chunk_size'} ? $myvar{'innodb_buffer_pool_chunk_size'} : "undefined");
6680+
infoprint " - innodb_buffer_pool_instances: " .
6681+
(defined $myvar{'innodb_buffer_pool_instances'} ? $myvar{'innodb_buffer_pool_instances'} : "undefined");
6682+
6683+
} else {
6684+
my $num_chunks = int($myvar{'innodb_buffer_pool_size'} / $myvar{'innodb_buffer_pool_chunk_size'});
6685+
infoprint "Number of InnoDB Buffer Pool Chunk: $num_chunks for "
6686+
. $myvar{'innodb_buffer_pool_instances'} . " Buffer Pool Instance(s)";
6687+
6688+
my $expected_size = int($myvar{'innodb_buffer_pool_chunk_size'}) *
6689+
int($myvar{'innodb_buffer_pool_instances'});
6690+
6691+
if (int($myvar{'innodb_buffer_pool_size'}) % $expected_size == 0) {
6692+
goodprint "Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances";
6693+
} else {
6694+
badprint "Innodb_buffer_pool_size not aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances";
66906695

6691-
#push( @adjvars, "Adjust innodb_buffer_pool_instances, innodb_buffer_pool_chunk_size with innodb_buffer_pool_size" );
6692-
push( @adjvars,
6693-
"innodb_buffer_pool_size must always be equal to or a multiple of innodb_buffer_pool_chunk_size * innodb_buffer_pool_instances"
6694-
);
6695-
}
6696+
push(@adjvars,
6697+
"innodb_buffer_pool_size must always be equal to or a multiple of innodb_buffer_pool_chunk_size * innodb_buffer_pool_instances"
6698+
);
66966699
}
6700+
}
66976701

66986702
# InnoDB Read efficiency
66996703
if ( defined $mycalc{'pct_read_efficiency'}

0 commit comments

Comments
 (0)