Generate 2.5.2 sub version at 2024-02-06T17:58:35+01:00
This commit is contained in:
parent
b3a776576e
commit
30d1d9ecc6
2 changed files with 62 additions and 44 deletions
2
USAGE.md
2
USAGE.md
|
@ -1,6 +1,6 @@
|
|||
# NAME
|
||||
|
||||
MySQLTuner 2.5.1 - MySQL High Performance Tuning Script
|
||||
MySQLTuner 2.5.2 - MySQL High Performance Tuning Script
|
||||
|
||||
# IMPORTANT USAGE GUIDELINES
|
||||
|
||||
|
|
104
mysqltuner.pl
104
mysqltuner.pl
|
@ -1,5 +1,4 @@
|
|||
#!/usr/bin/env perl
|
||||
# mysqltuner.pl - Version 2.5.1
|
||||
# mysqltuner.pl - Version 2.5.2
|
||||
# High Performance MySQL Tuning Script
|
||||
# Copyright (C) 2015-2023 Jean-Marie Renouard - jmrenouard@gmail.com
|
||||
# Copyright (C) 2006-2023 Major Hayden - major@mhtx.net
|
||||
|
@ -57,7 +56,7 @@ use Cwd 'abs_path';
|
|||
#use Env;
|
||||
|
||||
# Set up a few variables for use in the script
|
||||
my $tunerversion = "2.5.1";
|
||||
my $tunerversion = "2.5.2";
|
||||
my ( @adjvars, @generalrec );
|
||||
|
||||
# Set defaults
|
||||
|
@ -197,7 +196,7 @@ if ( exists $opt{passenv} && exists $ENV{ $opt{passenv} } ) {
|
|||
$opt{pass} = $opt{password} if ( $opt{pass} eq 0 and $opt{password} ne 0 );
|
||||
|
||||
if ( $opt{dumpdir} ne '' ) {
|
||||
$opt{dumpdir} = abs_path( $opt{dumpdir} );
|
||||
$opt{dumpdir}= abs_path($opt{dumpdir});
|
||||
if ( !-d $opt{dumpdir} ) {
|
||||
mkdir $opt{dumpdir} or die "Cannot create directory $opt{dumpdir}: $!";
|
||||
}
|
||||
|
@ -2526,7 +2525,7 @@ sub check_architecture {
|
|||
}
|
||||
elsif ( `uname` =~ /Darwin/ && `uname -m` =~ /x86_64/ ) {
|
||||
|
||||
# Darwin gibas.local 12.5.1 Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64
|
||||
# Darwin gibas.local 12.5.2 Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64
|
||||
$arch = 64;
|
||||
goodprint "Operating on 64-bit architecture";
|
||||
}
|
||||
|
@ -3211,6 +3210,11 @@ sub calculations {
|
|||
$mystat{'Innodb_buffer_pool_pages_total'}
|
||||
) if defined $mystat{'Innodb_buffer_pool_pages_total'};
|
||||
|
||||
$mycalc{'innodb_buffer_alloc_pct'}=select_one(
|
||||
"select round( 100* sum(allocated)/( select VARIABLE_VALUE ".
|
||||
"FROM performance_schema.global_variables " .
|
||||
"WHERE VARIABLE_NAME='innodb_buffer_pool_size' ) ,2)".
|
||||
'FROM sys.x\$innodb_buffer_stats_by_table;');
|
||||
# Binlog Cache
|
||||
if ( $myvar{'log_bin'} ne 'OFF' ) {
|
||||
$mycalc{'pct_binlog_cache'} = percentage(
|
||||
|
@ -6355,46 +6359,60 @@ sub mysql_innodb {
|
|||
. hr_bytes( $enginestats{'InnoDB'} )
|
||||
. ") if possible." );
|
||||
}
|
||||
|
||||
# select round( 100* sum(allocated)/( select VARIABLE_VALUE
|
||||
# FROM performance_schema.global_variables
|
||||
# where VARIABLE_NAME='innodb_buffer_pool_size' )
|
||||
# ,2) as "PCT ALLOC/BUFFER POOL"
|
||||
#from sys.x$innodb_buffer_stats_by_table;
|
||||
|
||||
if ($mycalc{innodb_buffer_alloc_pct} < 80) {
|
||||
badprint "Ratio Buffer Pool allocated / Buffer Pool Size: ".
|
||||
$mycalc{'innodb_buffer_alloc_pct'} . '%';
|
||||
} else {
|
||||
goodprint "Ratio Buffer Pool allocated / Buffer Pool Size: ".
|
||||
$mycalc{'innodb_buffer_alloc_pct'} . '%';
|
||||
}
|
||||
if ( $mycalc{'innodb_log_size_pct'} < 20
|
||||
or $mycalc{'innodb_log_size_pct'} > 30 )
|
||||
{
|
||||
if ( defined $myvar{'innodb_redo_log_capacity'} ) {
|
||||
badprint
|
||||
"Ratio InnoDB redo log capacity / InnoDB Buffer pool size ("
|
||||
. $mycalc{'innodb_log_size_pct'} . "%): "
|
||||
. hr_bytes( $myvar{'innodb_redo_log_capacity'} ) . " / "
|
||||
. hr_bytes( $myvar{'innodb_buffer_pool_size'} )
|
||||
. " should be equal to 25%";
|
||||
push( @adjvars,
|
||||
"innodb_redo_log_capacity should be (="
|
||||
. hr_bytes_rnd( $myvar{'innodb_buffer_pool_size'} / 4 )
|
||||
. ") if possible, so InnoDB Redo log Capacity equals 25% of buffer pool size."
|
||||
);
|
||||
push( @generalrec,
|
||||
"Be careful, increasing innodb_redo_log_capacity means higher crash recovery mean time"
|
||||
);
|
||||
}
|
||||
else {
|
||||
badprint "Ratio InnoDB log file size / InnoDB Buffer pool size ("
|
||||
. $mycalc{'innodb_log_size_pct'} . "%): "
|
||||
. hr_bytes( $myvar{'innodb_log_file_size'} ) . " * "
|
||||
. $myvar{'innodb_log_files_in_group'} . " / "
|
||||
. hr_bytes( $myvar{'innodb_buffer_pool_size'} )
|
||||
. " should be equal to 25%";
|
||||
push(
|
||||
@adjvars,
|
||||
"innodb_log_file_size should be (="
|
||||
. hr_bytes_rnd(
|
||||
$myvar{'innodb_buffer_pool_size'} /
|
||||
$myvar{'innodb_log_files_in_group'} / 4
|
||||
)
|
||||
. ") if possible, so InnoDB total log file size equals 25% of buffer pool size."
|
||||
);
|
||||
push( @generalrec,
|
||||
"Be careful, increasing innodb_log_file_size / innodb_log_files_in_group means higher crash recovery mean time"
|
||||
);
|
||||
}
|
||||
if ( mysql_version_le( 5, 6, 2 ) ) {
|
||||
if ( defined $myvar{'innodb_redo_log_capacity'} ) {
|
||||
badprint
|
||||
"Ratio InnoDB redo log capacity / InnoDB Buffer pool size ("
|
||||
. $mycalc{'innodb_log_size_pct'} . "%): "
|
||||
. hr_bytes( $myvar{'innodb_redo_log_capacity'} ) . " / "
|
||||
. hr_bytes( $myvar{'innodb_buffer_pool_size'} )
|
||||
. " should be equal to 25%";
|
||||
push( @adjvars,
|
||||
"innodb_redo_log_capacity should be (="
|
||||
. hr_bytes_rnd( $myvar{'innodb_buffer_pool_size'} / 4 )
|
||||
. ") if possible, so InnoDB Redo log Capacity equals 25% of buffer pool size."
|
||||
);
|
||||
push( @generalrec,
|
||||
"Be careful, increasing innodb_redo_log_capacity means higher crash recovery mean time"
|
||||
);
|
||||
}
|
||||
else {
|
||||
badprint "Ratio InnoDB log file size / InnoDB Buffer pool size ("
|
||||
. $mycalc{'innodb_log_size_pct'} . "%): "
|
||||
. hr_bytes( $myvar{'innodb_log_file_size'} ) . " * "
|
||||
. $myvar{'innodb_log_files_in_group'} . " / "
|
||||
. hr_bytes( $myvar{'innodb_buffer_pool_size'} )
|
||||
. " should be equal to 25%";
|
||||
push(
|
||||
@adjvars,
|
||||
"innodb_log_file_size should be (="
|
||||
. hr_bytes_rnd(
|
||||
$myvar{'innodb_buffer_pool_size'} /
|
||||
$myvar{'innodb_log_files_in_group'} / 4
|
||||
)
|
||||
. ") if possible, so InnoDB total log file size equals 25% of buffer pool size."
|
||||
);
|
||||
push( @generalrec,
|
||||
"Be careful, increasing innodb_log_file_size / innodb_log_files_in_group means higher crash recovery mean time"
|
||||
);
|
||||
}
|
||||
if ( mysql_version_le( 5, 6, 2 ) ) {
|
||||
push( @generalrec,
|
||||
"For MySQL 5.6.2 and lower, total innodb_log_file_size should have a ceiling of (4096MB / log files in group) - 1MB."
|
||||
);
|
||||
|
@ -7371,7 +7389,7 @@ __END__
|
|||
|
||||
=head1 NAME
|
||||
|
||||
MySQLTuner 2.5.1 - MySQL High Performance Tuning Script
|
||||
MySQLTuner 2.5.2 - MySQL High Performance Tuning Script
|
||||
|
||||
=head1 IMPORTANT USAGE GUIDELINES
|
||||
|
||||
|
|
Loading…
Reference in a new issue