Merge branch 'master' of https://github.com/major/MySQLTuner-perl
This commit is contained in:
commit
6284e95f18
6 changed files with 164 additions and 336 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -13,3 +13,5 @@ result_*
|
||||||
result.html
|
result.html
|
||||||
result.txt
|
result.txt
|
||||||
reports_*
|
reports_*
|
||||||
|
golang/prog-*
|
||||||
|
.vscode
|
||||||
|
|
|
@ -143,7 +143,9 @@ For previous MySQL 5.6 version, you can follow this command to create a new data
|
||||||
Optional Performance schema and Sysschema installation for MariaDB 10.x
|
Optional Performance schema and Sysschema installation for MariaDB 10.x
|
||||||
--
|
--
|
||||||
|
|
||||||
Sysschema is not installed by default under MariaDB prior to 10.6
|
Sysschema is not installed by default under MariaDB prior to 10.6 [MariaDB sys](https://mariadb.com/kb/en/sys-schema/)
|
||||||
|
|
||||||
|
|
||||||
By default, on MariaDB, performance schema is disabled by default. consider activating performance schema across your my.cnf configuration file:
|
By default, on MariaDB, performance schema is disabled by default. consider activating performance schema across your my.cnf configuration file:
|
||||||
|
|
||||||
[mysqld]
|
[mysqld]
|
||||||
|
@ -445,4 +447,3 @@ Simple steps to create a pull request:
|
||||||
- Push it back to your repo
|
- Push it back to your repo
|
||||||
- Click the Compare & pull request button
|
- Click the Compare & pull request button
|
||||||
- Click Create pull request to open a new pull request
|
- Click Create pull request to open a new pull request
|
||||||
|
|
||||||
|
|
23
USAGE.md
23
USAGE.md
|
@ -1,6 +1,6 @@
|
||||||
# NAME
|
# NAME
|
||||||
|
|
||||||
MySQLTuner2.0.5 - MySQL High Performance Tuning Script
|
MySQLTuner 2.0.10 - MySQL High Performance Tuning Script
|
||||||
|
|
||||||
# IMPORTANT USAGE GUIDELINES
|
# IMPORTANT USAGE GUIDELINES
|
||||||
|
|
||||||
|
@ -23,7 +23,8 @@ You must provide the remote server's total memory when connecting to other serve
|
||||||
--mysqladmin <path> Path to a custom mysqladmin executable
|
--mysqladmin <path> Path to a custom mysqladmin executable
|
||||||
--mysqlcmd <path> Path to a custom mysql executable
|
--mysqlcmd <path> Path to a custom mysql executable
|
||||||
--defaults-file <path> Path to a custom .my.cnf
|
--defaults-file <path> Path to a custom .my.cnf
|
||||||
--server-log <path> Path to explict log file (error_log)
|
--defaults-extra-file <path> Path to a extra custom config file
|
||||||
|
--server-log <path> Path to explicit log file (error_log)
|
||||||
|
|
||||||
# PERFORMANCE AND REPORTING OPTIONS
|
# PERFORMANCE AND REPORTING OPTIONS
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ You must provide the remote server's total memory when connecting to other serve
|
||||||
--updateversion Check for updates to MySQLTuner and update when newer version is available (default: don't check)
|
--updateversion Check for updates to MySQLTuner and update when newer version is available (default: don't check)
|
||||||
--forcemem <size> Amount of RAM installed in megabytes
|
--forcemem <size> Amount of RAM installed in megabytes
|
||||||
--forceswap <size> Amount of swap memory configured in megabytes
|
--forceswap <size> Amount of swap memory configured in megabytes
|
||||||
--passwordfile <path> Path to a password file list(one password by line)
|
--passwordfile <path> Path to a password file list (one password by line)
|
||||||
--cvefile <path> CVE File for vulnerability checks
|
--cvefile <path> CVE File for vulnerability checks
|
||||||
--outputfile <path> Path to a output txt file
|
--outputfile <path> Path to a output txt file
|
||||||
--reportfile <path> Path to a report txt file
|
--reportfile <path> Path to a report txt file
|
||||||
|
@ -45,7 +46,7 @@ You must provide the remote server's total memory when connecting to other serve
|
||||||
# OUTPUT OPTIONS
|
# OUTPUT OPTIONS
|
||||||
|
|
||||||
--silent Don't output anything on screen
|
--silent Don't output anything on screen
|
||||||
--verbose Prints out all options (default: no verbose, dbstat, idxstat, sysstat, tbstat, pfstat)
|
--verbose Print out all options (default: no verbose, dbstat, idxstat, sysstat, tbstat, pfstat)
|
||||||
--nocolor Don't print output in color
|
--nocolor Don't print output in color
|
||||||
--nogood Remove OK responses
|
--nogood Remove OK responses
|
||||||
--nobad Remove negative/suggestion responses
|
--nobad Remove negative/suggestion responses
|
||||||
|
@ -53,20 +54,20 @@ You must provide the remote server's total memory when connecting to other serve
|
||||||
--debug Print debug information
|
--debug Print debug information
|
||||||
--noprocess Consider no other process is running
|
--noprocess Consider no other process is running
|
||||||
--dbstat Print database information
|
--dbstat Print database information
|
||||||
--nodbstat Don't Print database information
|
--nodbstat Don't print database information
|
||||||
--tbstat Print table information
|
--tbstat Print table information
|
||||||
--notbstat Don't Print table information
|
--notbstat Don't print table information
|
||||||
--colstat Print column information
|
--colstat Print column information
|
||||||
--nocolstat Don't Print column information
|
--nocolstat Don't print column information
|
||||||
--idxstat Print index information
|
--idxstat Print index information
|
||||||
--noidxstat Don't Print index information
|
--noidxstat Don't print index information
|
||||||
--sysstat Print system information
|
--sysstat Print system information
|
||||||
--nosysstat Don't Print system information
|
--nosysstat Don't print system information
|
||||||
--pfstat Print Performance schema
|
--pfstat Print Performance schema
|
||||||
--nopfstat Don't Print Performance schema
|
--nopfstat Don't print Performance schema
|
||||||
--bannedports Ports banned separated by comma (,)
|
--bannedports Ports banned separated by comma (,)
|
||||||
--server-log Define specific error_log to analyze
|
--server-log Define specific error_log to analyze
|
||||||
--maxportallowed Number of ports opened allowed on this host
|
--maxportallowed Number of open ports allowable on this host
|
||||||
--buffers Print global and per-thread buffer values
|
--buffers Print global and per-thread buffer values
|
||||||
|
|
||||||
# PERLDOC
|
# PERLDOC
|
||||||
|
|
5
build/installStaff.sh
Normal file
5
build/installStaff.sh
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
apt install -y cpanminus libpod-markdown-perl libwww-mechanize-gzip-perl perltidy dos2unix
|
||||||
|
|
||||||
|
cpanm File::Util
|
130
mysqltuner.pl
130
mysqltuner.pl
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env perl
|
#!/usr/bin/env perl
|
||||||
# mysqltuner.pl - Version 2.0.7
|
# mysqltuner.pl - Version 2.0.10
|
||||||
# High Performance MySQL Tuning Script
|
# High Performance MySQL Tuning Script
|
||||||
# Copyright (C) 2006-2022 Major Hayden - major@mhtx.net
|
# Copyright (C) 2006-2022 Major Hayden - major@mhtx.net
|
||||||
# Copyright (C) 2015-2022 Jean-Marie Renouard - jmrenouard@gmail.com
|
# Copyright (C) 2015-2022 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.0.7";
|
my $tunerversion = "2.0.10";
|
||||||
my ( @adjvars, @generalrec );
|
my ( @adjvars, @generalrec );
|
||||||
|
|
||||||
# Set defaults
|
# Set defaults
|
||||||
|
@ -917,17 +917,21 @@ sub mysql_setup {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif ( $opt{'defaults-extra-file'} ne '' and -r "$opt{'defaults-extra-file'}" ) {
|
elsif ( $opt{'defaults-extra-file'} ne ''
|
||||||
|
and -r "$opt{'defaults-extra-file'}" )
|
||||||
|
{
|
||||||
|
|
||||||
# defaults-extra-file
|
# defaults-extra-file
|
||||||
debugprint "defaults extra file detected: $opt{'defaults-extra-file'}";
|
debugprint "defaults extra file detected: $opt{'defaults-extra-file'}";
|
||||||
my $mysqlclidefaults = `$mysqlcmd --print-defaults`;
|
my $mysqlclidefaults = `$mysqlcmd --print-defaults`;
|
||||||
debugprint "MySQL Client Extra Default File: $opt{'defaults-extra-file'}";
|
debugprint
|
||||||
|
"MySQL Client Extra Default File: $opt{'defaults-extra-file'}";
|
||||||
|
|
||||||
$mysqllogin = "--defaults-extra-file=" . $opt{'defaults-extra-file'};
|
$mysqllogin = "--defaults-extra-file=" . $opt{'defaults-extra-file'};
|
||||||
my $loginstatus = `$mysqladmincmd $mysqllogin ping 2>&1`;
|
my $loginstatus = `$mysqladmincmd $mysqllogin ping 2>&1`;
|
||||||
if ( $loginstatus =~ /mysqld is alive/ ) {
|
if ( $loginstatus =~ /mysqld is alive/ ) {
|
||||||
goodprint "Logged in using credentials from extra defaults file account.";
|
goodprint
|
||||||
|
"Logged in using credentials from extra defaults file account.";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1190,7 +1194,7 @@ sub get_all_vars {
|
||||||
$dummyselect = select_one "SELECT VERSION()";
|
$dummyselect = select_one "SELECT VERSION()";
|
||||||
if ( not defined($dummyselect) or $dummyselect eq "" ) {
|
if ( not defined($dummyselect) or $dummyselect eq "" ) {
|
||||||
badprint
|
badprint
|
||||||
"You probably do not have enough privileges to run MySQLTuner ...";
|
"You probably do not have enough privileges to run MySQLTuner ...";
|
||||||
exit(256);
|
exit(256);
|
||||||
}
|
}
|
||||||
$dummyselect =~ s/(.*?)\-.*/$1/;
|
$dummyselect =~ s/(.*?)\-.*/$1/;
|
||||||
|
@ -2240,7 +2244,10 @@ sub validate_mysql_version {
|
||||||
or mysql_version_eq( 10, 5 )
|
or mysql_version_eq( 10, 5 )
|
||||||
or mysql_version_eq( 10, 6 )
|
or mysql_version_eq( 10, 6 )
|
||||||
or mysql_version_eq( 10, 7 )
|
or mysql_version_eq( 10, 7 )
|
||||||
or mysql_version_eq( 10, 8 ) )
|
or mysql_version_eq( 10, 8 )
|
||||||
|
or mysql_version_eq( 10, 9 )
|
||||||
|
or mysql_version_eq( 10, 10 )
|
||||||
|
or mysql_version_eq( 10, 11 ) )
|
||||||
{
|
{
|
||||||
goodprint "Currently running supported MySQL version "
|
goodprint "Currently running supported MySQL version "
|
||||||
. $myvar{'version'} . "";
|
. $myvar{'version'} . "";
|
||||||
|
@ -2251,7 +2258,8 @@ sub validate_mysql_version {
|
||||||
. $myvar{'version'}
|
. $myvar{'version'}
|
||||||
. " is EOL software. Upgrade soon!";
|
. " is EOL software. Upgrade soon!";
|
||||||
push( @generalrec,
|
push( @generalrec,
|
||||||
"You are using an unsupported version for production environments" );
|
"You are using an unsupported version for production environments"
|
||||||
|
);
|
||||||
push( @generalrec,
|
push( @generalrec,
|
||||||
"Upgrade as soon as possible to a supported version !" );
|
"Upgrade as soon as possible to a supported version !" );
|
||||||
|
|
||||||
|
@ -2468,7 +2476,7 @@ sub check_storage_engines {
|
||||||
}
|
}
|
||||||
$result{'Tables'}{'Fragmented tables'} =
|
$result{'Tables'}{'Fragmented tables'} =
|
||||||
[ select_array
|
[ select_array
|
||||||
"SELECT CONCAT(CONCAT(TABLE_SCHEMA, '.'), TABLE_NAME),cast(DATA_FREE as signed) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema', 'performance_schema', 'mysql') AND DATA_LENGTH/1024/1024>100 AND cast(DATA_FREE as signed)*100/(DATA_LENGTH+INDEX_LENGTH+cast(DATA_FREE as signed)) > 10 AND NOT ENGINE='MEMORY' $not_innodb"
|
"SELECT TABLE_SCHEMA, TABLE_NAME, ENGINE, CAST(DATA_FREE AS SIGNED) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema', 'performance_schema', 'mysql') AND DATA_LENGTH/1024/1024>100 AND cast(DATA_FREE as signed)*100/(DATA_LENGTH+INDEX_LENGTH+cast(DATA_FREE as signed)) > 10 AND NOT ENGINE='MEMORY' $not_innodb"
|
||||||
];
|
];
|
||||||
$fragtables = scalar @{ $result{'Tables'}{'Fragmented tables'} };
|
$fragtables = scalar @{ $result{'Tables'}{'Fragmented tables'} };
|
||||||
|
|
||||||
|
@ -2551,28 +2559,34 @@ sub check_storage_engines {
|
||||||
{
|
{
|
||||||
badprint "MyISAM is enabled but isn't being used";
|
badprint "MyISAM is enabled but isn't being used";
|
||||||
push( @generalrec,
|
push( @generalrec,
|
||||||
"Add skip-isam to MySQL configuration to disable MyISAM (MySQL > 4.1.0)"
|
"Add skip-isam to MySQL configuration to disable MyISAM (MySQL > 4.1.0)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Fragmented tables
|
# Fragmented tables
|
||||||
if ( $fragtables > 0 ) {
|
if ( $fragtables > 0 ) {
|
||||||
badprint "Total fragmented tables: $fragtables";
|
badprint "Total fragmented tables: $fragtables";
|
||||||
push( @generalrec,
|
push @generalrec,
|
||||||
"Run OPTIMIZE TABLE to defragment tables for better performance" );
|
'Run ALTER TABLE ... FORCE or OPTIMIZE TABLE to defragment tables for better performance';
|
||||||
my $total_free = 0;
|
my $total_free = 0;
|
||||||
foreach my $table_line ( @{ $result{'Tables'}{'Fragmented tables'} } ) {
|
foreach my $table_line ( @{ $result{'Tables'}{'Fragmented tables'} } ) {
|
||||||
my ( $full_table_name, $data_free ) = split( /\s+/, $table_line );
|
my ( $table_schema, $table_name, $engine, $data_free ) =
|
||||||
$data_free = 0 if ( !defined($data_free) or $data_free eq '' );
|
split /\t/msx, $table_line;
|
||||||
$data_free = $data_free / 1024 / 1024;
|
$data_free = $data_free / 1024 / 1024;
|
||||||
$total_free += $data_free;
|
$total_free += $data_free;
|
||||||
my ( $table_schema, $table_name ) = split( /\./, $full_table_name );
|
my $generalrec;
|
||||||
push( @generalrec,
|
if ( $engine eq 'InnoDB' ) {
|
||||||
" OPTIMIZE TABLE `$table_schema`.`$table_name`; -- can free $data_free MB"
|
$generalrec =
|
||||||
);
|
" ALTER TABLE `$table_schema`.`$table_name` FORCE;";
|
||||||
}
|
}
|
||||||
push( @generalrec,
|
else {
|
||||||
"Total freed space after theses OPTIMIZE TABLE : $total_free Mb" );
|
$generalrec = " OPTIMIZE TABLE `$table_schema`.`$table_name`;";
|
||||||
|
}
|
||||||
|
$generalrec .= " -- can free $data_free MiB";
|
||||||
|
push @generalrec, $generalrec;
|
||||||
|
}
|
||||||
|
push @generalrec,
|
||||||
|
"Total freed space after defragmentation : $total_free MiB";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
goodprint "Total fragmented tables: $fragtables";
|
goodprint "Total fragmented tables: $fragtables";
|
||||||
|
@ -2629,8 +2643,7 @@ my %mycalc;
|
||||||
|
|
||||||
sub calculations {
|
sub calculations {
|
||||||
if ( $mystat{'Questions'} < 1 ) {
|
if ( $mystat{'Questions'} < 1 ) {
|
||||||
badprint
|
badprint "Your server has not answered any queries: cannot continue...";
|
||||||
"Your server has not answered any queries: cannot continue...";
|
|
||||||
exit 2;
|
exit 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3059,7 +3072,8 @@ sub mysql_stats {
|
||||||
. " global + "
|
. " global + "
|
||||||
. hr_bytes( $mycalc{'per_thread_buffers'} )
|
. hr_bytes( $mycalc{'per_thread_buffers'} )
|
||||||
. " per thread ($myvar{'max_connections'} max threads)";
|
. " per thread ($myvar{'max_connections'} max threads)";
|
||||||
infoprint "Performance_schema Max memory usage: " . hr_bytes_rnd( get_pf_memory() );
|
infoprint "Performance_schema Max memory usage: "
|
||||||
|
. hr_bytes_rnd( get_pf_memory() );
|
||||||
$result{'Performance_schema'}{'memory'} = get_pf_memory();
|
$result{'Performance_schema'}{'memory'} = get_pf_memory();
|
||||||
$result{'Performance_schema'}{'pretty_memory'} =
|
$result{'Performance_schema'}{'pretty_memory'} =
|
||||||
hr_bytes_rnd( get_pf_memory() );
|
hr_bytes_rnd( get_pf_memory() );
|
||||||
|
@ -3262,7 +3276,7 @@ sub mysql_stats {
|
||||||
}
|
}
|
||||||
elsif ( $mystat{'Com_select'} == 0 ) {
|
elsif ( $mystat{'Com_select'} == 0 ) {
|
||||||
badprint
|
badprint
|
||||||
"Query cache cannot be analyzed - no SELECT statements executed";
|
"Query cache cannot be analyzed: no SELECT statements executed";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
badprint
|
badprint
|
||||||
|
@ -3673,8 +3687,8 @@ sub mysql_myisam {
|
||||||
if ( $mycalc{'pct_key_buffer_used'} < 90 ) {
|
if ( $mycalc{'pct_key_buffer_used'} < 90 ) {
|
||||||
badprint "Key buffer used: $mycalc{'pct_key_buffer_used'}% ("
|
badprint "Key buffer used: $mycalc{'pct_key_buffer_used'}% ("
|
||||||
. hr_bytes( $myvar{'key_buffer_size'} -
|
. hr_bytes( $myvar{'key_buffer_size'} -
|
||||||
$mystat{'Key_blocks_unused'} *
|
$mystat{'Key_blocks_unused'} * $myvar{'key_cache_block_size'}
|
||||||
$myvar{'key_cache_block_size'} )
|
)
|
||||||
. " used / "
|
. " used / "
|
||||||
. hr_bytes( $myvar{'key_buffer_size'} )
|
. hr_bytes( $myvar{'key_buffer_size'} )
|
||||||
. " cache)";
|
. " cache)";
|
||||||
|
@ -3692,8 +3706,8 @@ sub mysql_myisam {
|
||||||
else {
|
else {
|
||||||
goodprint "Key buffer used: $mycalc{'pct_key_buffer_used'}% ("
|
goodprint "Key buffer used: $mycalc{'pct_key_buffer_used'}% ("
|
||||||
. hr_bytes( $myvar{'key_buffer_size'} -
|
. hr_bytes( $myvar{'key_buffer_size'} -
|
||||||
$mystat{'Key_blocks_unused'} *
|
$mystat{'Key_blocks_unused'} * $myvar{'key_cache_block_size'}
|
||||||
$myvar{'key_cache_block_size'} )
|
)
|
||||||
. " used / "
|
. " used / "
|
||||||
. hr_bytes( $myvar{'key_buffer_size'} )
|
. hr_bytes( $myvar{'key_buffer_size'} )
|
||||||
. " cache)";
|
. " cache)";
|
||||||
|
@ -3878,9 +3892,9 @@ sub get_pf_memory {
|
||||||
return 0 unless defined $myvar{'performance_schema'};
|
return 0 unless defined $myvar{'performance_schema'};
|
||||||
return 0 if $myvar{'performance_schema'} eq 'OFF';
|
return 0 if $myvar{'performance_schema'} eq 'OFF';
|
||||||
|
|
||||||
my @infoPFSMemory = grep /performance_schema.memory/,
|
my @infoPFSMemory = grep { /\tperformance_schema[.]memory\t/msx }
|
||||||
select_array("SHOW ENGINE PERFORMANCE_SCHEMA STATUS");
|
select_array("SHOW ENGINE PERFORMANCE_SCHEMA STATUS");
|
||||||
return 0 if scalar(@infoPFSMemory) == 0;
|
@infoPFSMemory == 1 || return 0;
|
||||||
$infoPFSMemory[0] =~ s/.*\s+(\d+)$/$1/g;
|
$infoPFSMemory[0] =~ s/.*\s+(\d+)$/$1/g;
|
||||||
return $infoPFSMemory[0];
|
return $infoPFSMemory[0];
|
||||||
}
|
}
|
||||||
|
@ -3901,16 +3915,17 @@ sub mysqsl_pfs {
|
||||||
if ( $myvar{'performance_schema'} eq 'ON' ) {
|
if ( $myvar{'performance_schema'} eq 'ON' ) {
|
||||||
infoprint "Performance_schema is activated.";
|
infoprint "Performance_schema is activated.";
|
||||||
debugprint "Performance schema is " . $myvar{'performance_schema'};
|
debugprint "Performance schema is " . $myvar{'performance_schema'};
|
||||||
infoprint "Memory used by Performance_schema: " . hr_bytes( get_pf_memory() );
|
infoprint "Memory used by Performance_schema: "
|
||||||
|
. hr_bytes( get_pf_memory() );
|
||||||
}
|
}
|
||||||
|
|
||||||
unless ( grep /^sys$/, select_array("SHOW DATABASES") ) {
|
unless ( grep /^sys$/, select_array("SHOW DATABASES") ) {
|
||||||
infoprint "Sys schema is not installed.";
|
infoprint "Sys schema is not installed.";
|
||||||
push( @generalrec,
|
push( @generalrec,
|
||||||
"Consider installing Sys schema from https://github.com/mysql/mysql-sys for MySQL"
|
"Consider installing Sys schema from https://github.com/mysql/mysql-sys for MySQL"
|
||||||
) unless ( mysql_version_le( 5, 6 ) );
|
) unless ( mysql_version_le( 5, 6 ) );
|
||||||
push( @generalrec,
|
push( @generalrec,
|
||||||
"Consider installing Sys schema from https://github.com/FromDual/mariadb-sys for MariaDB"
|
"Consider installing Sys schema from https://github.com/FromDual/mariadb-sys for MariaDB"
|
||||||
) unless ( mysql_version_ge( 10, 0 ) );
|
) unless ( mysql_version_ge( 10, 0 ) );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -5448,7 +5463,7 @@ sub mariadb_tokudb {
|
||||||
}
|
}
|
||||||
infoprint "TokuDB is enabled.";
|
infoprint "TokuDB is enabled.";
|
||||||
|
|
||||||
# All is to done here
|
# Not implemented
|
||||||
}
|
}
|
||||||
|
|
||||||
# Recommendations for XtraDB
|
# Recommendations for XtraDB
|
||||||
|
@ -5465,7 +5480,7 @@ sub mariadb_xtradb {
|
||||||
infoprint "XtraDB is enabled.";
|
infoprint "XtraDB is enabled.";
|
||||||
infoprint "Note that MariaDB 10.2 makes use of InnoDB, not XtraDB."
|
infoprint "Note that MariaDB 10.2 makes use of InnoDB, not XtraDB."
|
||||||
|
|
||||||
# All is to done here
|
# Not implemented
|
||||||
}
|
}
|
||||||
|
|
||||||
# Recommendations for RocksDB
|
# Recommendations for RocksDB
|
||||||
|
@ -5481,7 +5496,7 @@ sub mariadb_rockdb {
|
||||||
}
|
}
|
||||||
infoprint "RocksDB is enabled.";
|
infoprint "RocksDB is enabled.";
|
||||||
|
|
||||||
# All is to do here
|
# Not implemented
|
||||||
}
|
}
|
||||||
|
|
||||||
# Recommendations for Spider
|
# Recommendations for Spider
|
||||||
|
@ -5497,7 +5512,7 @@ sub mariadb_spider {
|
||||||
}
|
}
|
||||||
infoprint "Spider is enabled.";
|
infoprint "Spider is enabled.";
|
||||||
|
|
||||||
# All is to do here
|
# Not implemented
|
||||||
}
|
}
|
||||||
|
|
||||||
# Recommendations for Connect
|
# Recommendations for Connect
|
||||||
|
@ -5513,7 +5528,7 @@ sub mariadb_connect {
|
||||||
}
|
}
|
||||||
infoprint "Connect is enabled.";
|
infoprint "Connect is enabled.";
|
||||||
|
|
||||||
# All is to do here
|
# Not implemented
|
||||||
}
|
}
|
||||||
|
|
||||||
# Perl trim function to remove whitespace from the start and end of the string
|
# Perl trim function to remove whitespace from the start and end of the string
|
||||||
|
@ -5613,19 +5628,19 @@ having sum(if(c.column_key in ('PRI','UNI'), 1,0)) = 0"
|
||||||
or get_wsrep_option('wsrep_slave_threads') < ( (cpu_cores) * 2 ) )
|
or get_wsrep_option('wsrep_slave_threads') < ( (cpu_cores) * 2 ) )
|
||||||
{
|
{
|
||||||
badprint
|
badprint
|
||||||
"wsrep_slave_threads is not equal to 2, 3 or 4 times the number of CPU(s)";
|
"wsrep_slave_threads is not equal to 2, 3 or 4 times the number of CPU(s)";
|
||||||
push @adjvars, "wsrep_slave_threads = " . ( (cpu_cores) * 4 );
|
push @adjvars, "wsrep_slave_threads = " . ( (cpu_cores) * 4 );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
goodprint
|
goodprint
|
||||||
"wsrep_slave_threads is equal to 2, 3 or 4 times the number of CPU(s)";
|
"wsrep_slave_threads is equal to 2, 3 or 4 times the number of CPU(s)";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( get_wsrep_option('wsrep_slave_threads') > 1 ) {
|
if ( get_wsrep_option('wsrep_slave_threads') > 1 ) {
|
||||||
infoprint
|
infoprint
|
||||||
"wsrep parallel slave can cause frequent inconsistency crash.";
|
"wsrep parallel slave can cause frequent inconsistency crash.";
|
||||||
push @adjvars,
|
push @adjvars,
|
||||||
"Set wsrep_slave_threads to 1 in case of HA_ERR_FOUND_DUPP_KEY crash on slave";
|
"Set wsrep_slave_threads to 1 in case of HA_ERR_FOUND_DUPP_KEY crash on slave";
|
||||||
|
|
||||||
# check options for parallel slave
|
# check options for parallel slave
|
||||||
if ( get_wsrep_option('wsrep_slave_FK_checks') eq "OFF" ) {
|
if ( get_wsrep_option('wsrep_slave_FK_checks') eq "OFF" ) {
|
||||||
|
@ -5668,7 +5683,7 @@ having sum(if(c.column_key in ('PRI','UNI'), 1,0)) = 0"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
goodprint
|
goodprint
|
||||||
"Flow control fraction seems to be OK (wsrep_flow_control_paused <= 0.02)";
|
"Flow control fraction seems to be OK (wsrep_flow_control_paused <= 0.02)";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( scalar(@primaryKeysNbTables) > 0 ) {
|
if ( scalar(@primaryKeysNbTables) > 0 ) {
|
||||||
|
@ -5730,14 +5745,14 @@ having sum(if(c.column_key in ('PRI','UNI'), 1,0)) = 0"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
badprint
|
badprint
|
||||||
"There are $nbNodesSize nodes in wsrep_cluster_size. Prefer 3 or 5 nodes architecture.";
|
"There are $nbNodesSize nodes in wsrep_cluster_size. Prefer 3 or 5 nodes architecture.";
|
||||||
push @generalrec, "Prefer 3 or 5 nodes architecture.";
|
push @generalrec, "Prefer 3 or 5 nodes architecture.";
|
||||||
}
|
}
|
||||||
|
|
||||||
# wsrep_cluster_address doesn't include garbd nodes
|
# wsrep_cluster_address doesn't include garbd nodes
|
||||||
if ( $nbNodes > $nbNodesSize ) {
|
if ( $nbNodes > $nbNodesSize ) {
|
||||||
badprint
|
badprint
|
||||||
"All cluster nodes are not detected. wsrep_cluster_size less than node count in wsrep_cluster_address";
|
"All cluster nodes are not detected. wsrep_cluster_size less than node count in wsrep_cluster_address";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
goodprint "All cluster nodes detected.";
|
goodprint "All cluster nodes detected.";
|
||||||
|
@ -5775,14 +5790,15 @@ having sum(if(c.column_key in ('PRI','UNI'), 1,0)) = 0"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
badprint "Galera Notify command is not defined.";
|
badprint "Galera Notify command is not defined.";
|
||||||
push( @adjvars, "set up parameter wsrep_notify_cmd to be notified" );
|
push( @adjvars,
|
||||||
|
"set up parameter wsrep_notify_cmd to be notified" );
|
||||||
}
|
}
|
||||||
if ( trim( $myvar{'wsrep_sst_method'} ) !~ "^xtrabackup.*"
|
if ( trim( $myvar{'wsrep_sst_method'} ) !~ "^xtrabackup.*"
|
||||||
and trim( $myvar{'wsrep_sst_method'} ) !~ "^mariabackup" )
|
and trim( $myvar{'wsrep_sst_method'} ) !~ "^mariabackup" )
|
||||||
{
|
{
|
||||||
badprint "Galera SST method is not xtrabackup based.";
|
badprint "Galera SST method is not xtrabackup based.";
|
||||||
push( @adjvars,
|
push( @adjvars,
|
||||||
"set up parameter wsrep_sst_method to xtrabackup based parameter"
|
"set up parameter wsrep_sst_method to xtrabackup based parameter"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -5884,10 +5900,10 @@ sub mysql_innodb {
|
||||||
$defengine = $myvar{'default_storage_engine'}
|
$defengine = $myvar{'default_storage_engine'}
|
||||||
if defined( $myvar{'default_storage_engine'} );
|
if defined( $myvar{'default_storage_engine'} );
|
||||||
badprint
|
badprint
|
||||||
"InnoDB Storage engine is disabled. $defengine is the default storage engine"
|
"InnoDB Storage engine is disabled. $defengine is the default storage engine"
|
||||||
if $defengine eq 'InnoDB';
|
if $defengine eq 'InnoDB';
|
||||||
infoprint
|
infoprint
|
||||||
"InnoDB Storage engine is disabled. $defengine is the default storage engine"
|
"InnoDB Storage engine is disabled. $defengine is the default storage engine"
|
||||||
if $defengine ne 'InnoDB';
|
if $defengine ne 'InnoDB';
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -6112,7 +6128,7 @@ sub mysql_innodb {
|
||||||
. $mycalc{'pct_read_efficiency'} . "% ("
|
. $mycalc{'pct_read_efficiency'} . "% ("
|
||||||
. ( $mystat{'Innodb_buffer_pool_read_requests'} -
|
. ( $mystat{'Innodb_buffer_pool_read_requests'} -
|
||||||
$mystat{'Innodb_buffer_pool_reads'} )
|
$mystat{'Innodb_buffer_pool_reads'} )
|
||||||
. " hits/ "
|
. " hits / "
|
||||||
. $mystat{'Innodb_buffer_pool_read_requests'}
|
. $mystat{'Innodb_buffer_pool_read_requests'}
|
||||||
. " total)";
|
. " total)";
|
||||||
}
|
}
|
||||||
|
@ -6121,7 +6137,7 @@ sub mysql_innodb {
|
||||||
. $mycalc{'pct_read_efficiency'} . "% ("
|
. $mycalc{'pct_read_efficiency'} . "% ("
|
||||||
. ( $mystat{'Innodb_buffer_pool_read_requests'} -
|
. ( $mystat{'Innodb_buffer_pool_read_requests'} -
|
||||||
$mystat{'Innodb_buffer_pool_reads'} )
|
$mystat{'Innodb_buffer_pool_reads'} )
|
||||||
. " hits/ "
|
. " hits / "
|
||||||
. $mystat{'Innodb_buffer_pool_read_requests'}
|
. $mystat{'Innodb_buffer_pool_read_requests'}
|
||||||
. " total)";
|
. " total)";
|
||||||
}
|
}
|
||||||
|
@ -6134,7 +6150,7 @@ sub mysql_innodb {
|
||||||
. abs( $mycalc{'pct_write_efficiency'} ) . "% ("
|
. abs( $mycalc{'pct_write_efficiency'} ) . "% ("
|
||||||
. abs( $mystat{'Innodb_log_write_requests'} -
|
. abs( $mystat{'Innodb_log_write_requests'} -
|
||||||
$mystat{'Innodb_log_writes'} )
|
$mystat{'Innodb_log_writes'} )
|
||||||
. " hits/ "
|
. " hits / "
|
||||||
. $mystat{'Innodb_log_write_requests'}
|
. $mystat{'Innodb_log_write_requests'}
|
||||||
. " total)";
|
. " total)";
|
||||||
}
|
}
|
||||||
|
@ -6143,7 +6159,7 @@ sub mysql_innodb {
|
||||||
. $mycalc{'pct_write_efficiency'} . "% ("
|
. $mycalc{'pct_write_efficiency'} . "% ("
|
||||||
. ( $mystat{'Innodb_log_write_requests'} -
|
. ( $mystat{'Innodb_log_write_requests'} -
|
||||||
$mystat{'Innodb_log_writes'} )
|
$mystat{'Innodb_log_writes'} )
|
||||||
. " hits/ "
|
. " hits / "
|
||||||
. $mystat{'Innodb_log_write_requests'}
|
. $mystat{'Innodb_log_write_requests'}
|
||||||
. " total)";
|
. " total)";
|
||||||
}
|
}
|
||||||
|
@ -6554,7 +6570,7 @@ sub mysql_indexes {
|
||||||
subheaderprint "Indexes Metrics";
|
subheaderprint "Indexes Metrics";
|
||||||
unless ( mysql_version_ge( 5, 5 ) ) {
|
unless ( mysql_version_ge( 5, 5 ) ) {
|
||||||
infoprint
|
infoprint
|
||||||
"Skip Index metrics from information schema are missing in this version";
|
"Skip Index metrics from information schema are missing in this version";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6681,7 +6697,7 @@ sub mysql_views() {
|
||||||
subheaderprint "Views Metrics";
|
subheaderprint "Views Metrics";
|
||||||
unless ( mysql_version_ge( 5, 5 ) ) {
|
unless ( mysql_version_ge( 5, 5 ) ) {
|
||||||
infoprint
|
infoprint
|
||||||
"Skip Index metrics from information schema are missing in this version";
|
"Skip Index metrics from information schema are missing in this version";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6690,7 +6706,7 @@ sub mysql_routines() {
|
||||||
subheaderprint "Routines Metrics";
|
subheaderprint "Routines Metrics";
|
||||||
unless ( mysql_version_ge( 5, 5 ) ) {
|
unless ( mysql_version_ge( 5, 5 ) ) {
|
||||||
infoprint
|
infoprint
|
||||||
"Skip Index metrics from information schema are missing in this version";
|
"Skip Index metrics from information schema are missing in this version";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6699,7 +6715,7 @@ sub mysql_triggers() {
|
||||||
subheaderprint "Triggers Metrics";
|
subheaderprint "Triggers Metrics";
|
||||||
unless ( mysql_version_ge( 5, 5 ) ) {
|
unless ( mysql_version_ge( 5, 5 ) ) {
|
||||||
infoprint
|
infoprint
|
||||||
"Skip Index metrics from information schema are missing in this version";
|
"Skip Index metrics from information schema are missing in this version";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6925,7 +6941,7 @@ __END__
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
MySQLTuner 2.0.7 - MySQL High Performance Tuning Script
|
MySQLTuner 2.0.10 - MySQL High Performance Tuning Script
|
||||||
|
|
||||||
=head1 IMPORTANT USAGE GUIDELINES
|
=head1 IMPORTANT USAGE GUIDELINES
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue