Skip to content

Commit 30d1d9e

Browse files
committed
Generate 2.5.2 sub version at 2024-02-06T17:58:35+01:00
1 parent b3a7765 commit 30d1d9e

File tree

2 files changed

+62
-44
lines changed

2 files changed

+62
-44
lines changed

USAGE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NAME
22

3-
MySQLTuner 2.5.1 - MySQL High Performance Tuning Script
3+
MySQLTuner 2.5.2 - MySQL High Performance Tuning Script
44

55
# IMPORTANT USAGE GUIDELINES
66

mysqltuner.pl

+61-43
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#!/usr/bin/env perl
2-
# mysqltuner.pl - Version 2.5.1
1+
# mysqltuner.pl - Version 2.5.2
32
# High Performance MySQL Tuning Script
43
# Copyright (C) 2015-2023 Jean-Marie Renouard - jmrenouard@gmail.com
54
# Copyright (C) 2006-2023 Major Hayden - major@mhtx.net
@@ -57,7 +56,7 @@ package main;
5756
#use Env;
5857

5958
# Set up a few variables for use in the script
60-
my $tunerversion = "2.5.1";
59+
my $tunerversion = "2.5.2";
6160
my ( @adjvars, @generalrec );
6261

6362
# Set defaults
@@ -197,7 +196,7 @@ package main;
197196
$opt{pass} = $opt{password} if ( $opt{pass} eq 0 and $opt{password} ne 0 );
198197

199198
if ( $opt{dumpdir} ne '' ) {
200-
$opt{dumpdir} = abs_path( $opt{dumpdir} );
199+
$opt{dumpdir}= abs_path($opt{dumpdir});
201200
if ( !-d $opt{dumpdir} ) {
202201
mkdir $opt{dumpdir} or die "Cannot create directory $opt{dumpdir}: $!";
203202
}
@@ -2526,7 +2525,7 @@ sub check_architecture {
25262525
}
25272526
elsif ( `uname` =~ /Darwin/ && `uname -m` =~ /x86_64/ ) {
25282527

2529-
# 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
2528+
# 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
25302529
$arch = 64;
25312530
goodprint "Operating on 64-bit architecture";
25322531
}
@@ -3211,6 +3210,11 @@ sub calculations {
32113210
$mystat{'Innodb_buffer_pool_pages_total'}
32123211
) if defined $mystat{'Innodb_buffer_pool_pages_total'};
32133212

3213+
$mycalc{'innodb_buffer_alloc_pct'}=select_one(
3214+
"select round( 100* sum(allocated)/( select VARIABLE_VALUE ".
3215+
"FROM performance_schema.global_variables " .
3216+
"WHERE VARIABLE_NAME='innodb_buffer_pool_size' ) ,2)".
3217+
'FROM sys.x\$innodb_buffer_stats_by_table;');
32143218
# Binlog Cache
32153219
if ( $myvar{'log_bin'} ne 'OFF' ) {
32163220
$mycalc{'pct_binlog_cache'} = percentage(
@@ -6355,46 +6359,60 @@ sub mysql_innodb {
63556359
. hr_bytes( $enginestats{'InnoDB'} )
63566360
. ") if possible." );
63576361
}
6362+
6363+
# select round( 100* sum(allocated)/( select VARIABLE_VALUE
6364+
# FROM performance_schema.global_variables
6365+
# where VARIABLE_NAME='innodb_buffer_pool_size' )
6366+
# ,2) as "PCT ALLOC/BUFFER POOL"
6367+
#from sys.x$innodb_buffer_stats_by_table;
6368+
6369+
if ($mycalc{innodb_buffer_alloc_pct} < 80) {
6370+
badprint "Ratio Buffer Pool allocated / Buffer Pool Size: ".
6371+
$mycalc{'innodb_buffer_alloc_pct'} . '%';
6372+
} else {
6373+
goodprint "Ratio Buffer Pool allocated / Buffer Pool Size: ".
6374+
$mycalc{'innodb_buffer_alloc_pct'} . '%';
6375+
}
63586376
if ( $mycalc{'innodb_log_size_pct'} < 20
63596377
or $mycalc{'innodb_log_size_pct'} > 30 )
63606378
{
6361-
if ( defined $myvar{'innodb_redo_log_capacity'} ) {
6362-
badprint
6363-
"Ratio InnoDB redo log capacity / InnoDB Buffer pool size ("
6364-
. $mycalc{'innodb_log_size_pct'} . "%): "
6365-
. hr_bytes( $myvar{'innodb_redo_log_capacity'} ) . " / "
6366-
. hr_bytes( $myvar{'innodb_buffer_pool_size'} )
6367-
. " should be equal to 25%";
6368-
push( @adjvars,
6369-
"innodb_redo_log_capacity should be (="
6370-
. hr_bytes_rnd( $myvar{'innodb_buffer_pool_size'} / 4 )
6371-
. ") if possible, so InnoDB Redo log Capacity equals 25% of buffer pool size."
6372-
);
6373-
push( @generalrec,
6374-
"Be careful, increasing innodb_redo_log_capacity means higher crash recovery mean time"
6375-
);
6376-
}
6377-
else {
6378-
badprint "Ratio InnoDB log file size / InnoDB Buffer pool size ("
6379-
. $mycalc{'innodb_log_size_pct'} . "%): "
6380-
. hr_bytes( $myvar{'innodb_log_file_size'} ) . " * "
6381-
. $myvar{'innodb_log_files_in_group'} . " / "
6382-
. hr_bytes( $myvar{'innodb_buffer_pool_size'} )
6383-
. " should be equal to 25%";
6384-
push(
6385-
@adjvars,
6386-
"innodb_log_file_size should be (="
6387-
. hr_bytes_rnd(
6388-
$myvar{'innodb_buffer_pool_size'} /
6389-
$myvar{'innodb_log_files_in_group'} / 4
6390-
)
6391-
. ") if possible, so InnoDB total log file size equals 25% of buffer pool size."
6392-
);
6393-
push( @generalrec,
6394-
"Be careful, increasing innodb_log_file_size / innodb_log_files_in_group means higher crash recovery mean time"
6395-
);
6396-
}
6397-
if ( mysql_version_le( 5, 6, 2 ) ) {
6379+
if ( defined $myvar{'innodb_redo_log_capacity'} ) {
6380+
badprint
6381+
"Ratio InnoDB redo log capacity / InnoDB Buffer pool size ("
6382+
. $mycalc{'innodb_log_size_pct'} . "%): "
6383+
. hr_bytes( $myvar{'innodb_redo_log_capacity'} ) . " / "
6384+
. hr_bytes( $myvar{'innodb_buffer_pool_size'} )
6385+
. " should be equal to 25%";
6386+
push( @adjvars,
6387+
"innodb_redo_log_capacity should be (="
6388+
. hr_bytes_rnd( $myvar{'innodb_buffer_pool_size'} / 4 )
6389+
. ") if possible, so InnoDB Redo log Capacity equals 25% of buffer pool size."
6390+
);
6391+
push( @generalrec,
6392+
"Be careful, increasing innodb_redo_log_capacity means higher crash recovery mean time"
6393+
);
6394+
}
6395+
else {
6396+
badprint "Ratio InnoDB log file size / InnoDB Buffer pool size ("
6397+
. $mycalc{'innodb_log_size_pct'} . "%): "
6398+
. hr_bytes( $myvar{'innodb_log_file_size'} ) . " * "
6399+
. $myvar{'innodb_log_files_in_group'} . " / "
6400+
. hr_bytes( $myvar{'innodb_buffer_pool_size'} )
6401+
. " should be equal to 25%";
6402+
push(
6403+
@adjvars,
6404+
"innodb_log_file_size should be (="
6405+
. hr_bytes_rnd(
6406+
$myvar{'innodb_buffer_pool_size'} /
6407+
$myvar{'innodb_log_files_in_group'} / 4
6408+
)
6409+
. ") if possible, so InnoDB total log file size equals 25% of buffer pool size."
6410+
);
6411+
push( @generalrec,
6412+
"Be careful, increasing innodb_log_file_size / innodb_log_files_in_group means higher crash recovery mean time"
6413+
);
6414+
}
6415+
if ( mysql_version_le( 5, 6, 2 ) ) {
63986416
push( @generalrec,
63996417
"For MySQL 5.6.2 and lower, total innodb_log_file_size should have a ceiling of (4096MB / log files in group) - 1MB."
64006418
);
@@ -7371,7 +7389,7 @@ sub which {
73717389
73727390
=head1 NAME
73737391
7374-
MySQLTuner 2.5.1 - MySQL High Performance Tuning Script
7392+
MySQLTuner 2.5.2 - MySQL High Performance Tuning Script
73757393
73767394
=head1 IMPORTANT USAGE GUIDELINES
73777395

0 commit comments

Comments
 (0)