Merge pull request #688 from jmrenouard/master
Version 2.2.0 issues #686
This commit is contained in:
commit
9bf2c0429b
2 changed files with 38 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env perl
|
#!/usr/bin/env perl
|
||||||
# mysqltuner.pl - Version 2.2.0
|
# mysqltuner.pl - Version 2.2.1
|
||||||
# High Performance MySQL Tuning Script
|
# High Performance MySQL Tuning Script
|
||||||
# Copyright (C) 2006-2023 Major Hayden - major@mhtx.net
|
# Copyright (C) 2006-2023 Major Hayden - major@mhtx.net
|
||||||
# Copyright (C) 2015-2023 Jean-Marie Renouard - jmrenouard@gmail.com
|
# Copyright (C) 2015-2023 Jean-Marie Renouard - jmrenouard@gmail.com
|
||||||
|
@ -57,7 +57,7 @@ use Cwd 'abs_path';
|
||||||
#use Env;
|
#use Env;
|
||||||
|
|
||||||
# Set up a few variables for use in the script
|
# Set up a few variables for use in the script
|
||||||
my $tunerversion = "2.2.0";
|
my $tunerversion = "2.2.1";
|
||||||
my ( @adjvars, @generalrec );
|
my ( @adjvars, @generalrec );
|
||||||
|
|
||||||
# Set defaults
|
# Set defaults
|
||||||
|
@ -69,8 +69,8 @@ my %opt = (
|
||||||
"debug" => 0,
|
"debug" => 0,
|
||||||
"nocolor" => ( !-t STDOUT ),
|
"nocolor" => ( !-t STDOUT ),
|
||||||
"color" => 0,
|
"color" => 0,
|
||||||
"forcemem" => 1024,
|
"forcemem" => 0,
|
||||||
"forceswap" => 1024,
|
"forceswap" => 0,
|
||||||
"host" => 0,
|
"host" => 0,
|
||||||
"socket" => 0,
|
"socket" => 0,
|
||||||
"port" => 0,
|
"port" => 0,
|
||||||
|
@ -811,7 +811,15 @@ sub mysql_setup {
|
||||||
# If we're doing a remote connection, but forcemem wasn't specified, we need to exit
|
# If we're doing a remote connection, but forcemem wasn't specified, we need to exit
|
||||||
if ( $opt{'forcemem'} eq 0 && is_remote eq 1 ) {
|
if ( $opt{'forcemem'} eq 0 && is_remote eq 1 ) {
|
||||||
badprint "The --forcemem option is required for remote connections";
|
badprint "The --forcemem option is required for remote connections";
|
||||||
exit 1;
|
badprint "Assuming RAM memory is 1Gb for simplify remote connection usage";
|
||||||
|
$opt{'forcemem'} = 1024;
|
||||||
|
#exit 1;
|
||||||
|
}
|
||||||
|
if ( $opt{'forceswap'} eq 0 && is_remote eq 1 ) {
|
||||||
|
badprint "The --forceswap option is required for remote connections";
|
||||||
|
badprint "Assuming Swap size is 1Gb for simplify remote connection usage";
|
||||||
|
$opt{'forceswap'} = 1024;
|
||||||
|
#exit 1;
|
||||||
}
|
}
|
||||||
infoprint "Performing tests on $opt{host}:$opt{port}";
|
infoprint "Performing tests on $opt{host}:$opt{port}";
|
||||||
$remotestring = " -h $opt{host} -P $opt{port}";
|
$remotestring = " -h $opt{host} -P $opt{port}";
|
||||||
|
@ -1974,9 +1982,26 @@ sub system_recommendations {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
prettyprint "Look for related Linux system recommendations";
|
prettyprint "Look for related Linux system recommendations";
|
||||||
|
|
||||||
#prettyprint '-'x78;
|
#prettyprint '-'x78;
|
||||||
get_system_info();
|
get_system_info();
|
||||||
|
|
||||||
|
|
||||||
|
my $nb_cpus = cpu_cores;
|
||||||
|
if ($nb_cpus > 1) {
|
||||||
|
goodprint "There is at least one CPU dedicated to database server.";
|
||||||
|
} else {
|
||||||
|
badprint "There is only one CPU, consider dedicated one CPU for your database server";
|
||||||
|
push @generalrec, "Consider increasing number of CPU for your database server";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($physical_memory < 1600) {
|
||||||
|
goodprint "There is at least 1 Gb of RAM dedicated to Linux server.";
|
||||||
|
} else {
|
||||||
|
badprint "There is less than 1,5 Gb of RAM, consider dedicated 1 Gb for your Linux server";
|
||||||
|
push @generalrec, "Consider increasing 1,5 / 2 Gb of RAM for your Linux server";
|
||||||
|
}
|
||||||
|
|
||||||
my $omem = get_other_process_memory;
|
my $omem = get_other_process_memory;
|
||||||
infoprint "User process except mysqld used "
|
infoprint "User process except mysqld used "
|
||||||
. hr_bytes_rnd($omem) . " RAM.";
|
. hr_bytes_rnd($omem) . " RAM.";
|
||||||
|
@ -5808,7 +5833,6 @@ or COLLATION_name LIKE 'utf8%');"
|
||||||
);
|
);
|
||||||
$tmpContent='Schema,Table,Column, Charset, Collation, Data Type, Max Length';
|
$tmpContent='Schema,Table,Column, Charset, Collation, Data Type, Max Length';
|
||||||
foreach my $badtable (@utf8columns) {
|
foreach my $badtable (@utf8columns) {
|
||||||
badprint "\t$badtable";
|
|
||||||
$tmpContent.="\n$badtable";
|
$tmpContent.="\n$badtable";
|
||||||
}
|
}
|
||||||
dump_into_file( "columns_utf8.csv", $tmpContent );
|
dump_into_file( "columns_utf8.csv", $tmpContent );
|
||||||
|
@ -7225,7 +7249,7 @@ __END__
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
MySQLTuner 2.2.0 - MySQL High Performance Tuning Script
|
MySQLTuner 2.2.1 - MySQL High Performance Tuning Script
|
||||||
|
|
||||||
=head1 IMPORTANT USAGE GUIDELINES
|
=head1 IMPORTANT USAGE GUIDELINES
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
{
|
{
|
||||||
"extends": [
|
"extends": [
|
||||||
"config:base"
|
"config:base"
|
||||||
]
|
],
|
||||||
}
|
"git-submodules": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"dependencyDashboard": true
|
||||||
|
}
|
Loading…
Reference in a new issue