Last modification related to options

This commit is contained in:
Jean-Marie Renouard 2018-11-26 12:57:11 +00:00
parent 0f724fa31f
commit 1b9e4e75ba
2 changed files with 123 additions and 83 deletions

View file

@ -1,6 +1,6 @@
# NAME # NAME
MySQLTuner 1.7.11 - MySQL High Performance Tuning Script MySQLTuner 1.7.14 - MySQL High Performance Tuning Script
# IMPORTANT USAGE GUIDELINES # IMPORTANT USAGE GUIDELINES
@ -41,12 +41,19 @@ You must provide the remote server's total memory when connecting to other serve
--nobad Remove negative/suggestion responses --nobad Remove negative/suggestion responses
--noinfo Remove informational responses --noinfo Remove informational responses
--debug Print debug information --debug Print debug information
--noprocess Consider no other process is running
--dbstat Print database information --dbstat 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
--idxstat Print index information --idxstat Print index information
--noidxstat Don't Print index information
--sysstat Print system information --sysstat Print system information
--nosysstat Don't Print system information
--pfstat Print Performance schema --pfstat Print Performance schema
--nopfstat Don't Print Performance schema
--verbose Prints out all options (default: no verbose, dbstat, idxstat, sysstat, tbstat, pfstat)
--bannedports Ports banned separated by comma(,) --bannedports Ports banned separated by comma(,)
--maxportallowed Number of ports opened allowed on this hosts --maxportallowed Number of ports opened allowed on this hosts
--cvefile <path> CVE File for vulnerability checks --cvefile <path> CVE File for vulnerability checks
@ -56,7 +63,6 @@ You must provide the remote server's total memory when connecting to other serve
--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
--template <path> Path to a template file --template <path> Path to a template file
--verbose Prints out all options (default: no verbose)
# PERLDOC # PERLDOC

View file

@ -1,5 +1,5 @@
#!/usr/bin/env perl #!/usr/bin/env perl
# mysqltuner.pl - Version 1.7.13 # mysqltuner.pl - Version 1.7.14
# High Performance MySQL Tuning Script # High Performance MySQL Tuning Script
# Copyright (C) 2006-2018 Major Hayden - major@mhtx.net # Copyright (C) 2006-2018 Major Hayden - major@mhtx.net
# #
@ -56,7 +56,7 @@ $Data::Dumper::Pair = " : ";
#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 = "1.7.13"; my $tunerversion = "1.7.14";
my ( @adjvars, @generalrec ); my ( @adjvars, @generalrec );
# Set defaults # Set defaults
@ -85,12 +85,17 @@ my %opt = (
"bannedports" => '', "bannedports" => '',
"maxportallowed" => 0, "maxportallowed" => 0,
"outputfile" => 0, "outputfile" => 0,
"noprocess" => 0,
"dbstat" => 0, "dbstat" => 0,
"nodbstat" => 0,
"tbstat" => 0, "tbstat" => 0,
"notbstat" => 0, "notbstat" => 0,
"idxstat" => 0, "idxstat" => 0,
"noidxstat" => 0,
"sysstat" => 0, "sysstat" => 0,
"nosysstat" => 0,
"pfstat" => 0, "pfstat" => 0,
"nopfstat" => 0,
"skippassword" => 0, "skippassword" => 0,
"noask" => 0, "noask" => 0,
"template" => 0, "template" => 0,
@ -114,18 +119,20 @@ GetOptions(
'mysqlcmd=s', 'help', 'mysqlcmd=s', 'help',
'buffers', 'skippassword', 'buffers', 'skippassword',
'passwordfile=s', 'outputfile=s', 'passwordfile=s', 'outputfile=s',
'silent', 'dbstat', 'silent', 'noask',
'json', 'prettyjson', 'json', 'prettyjson',
'idxstat', 'noask',
'template=s', 'reportfile=s', 'template=s', 'reportfile=s',
'cvefile=s', 'bannedports=s', 'cvefile=s', 'bannedports=s',
'updateversion', 'maxportallowed=s', 'updateversion', 'maxportallowed=s',
'verbose', 'sysstat', 'verbose', 'password=s',
'password=s', 'pfstat',
'passenv=s', 'userenv=s', 'passenv=s', 'userenv=s',
'defaults-file=s', 'ssl-ca=s', 'defaults-file=s', 'ssl-ca=s',
'color', 'tbstat', 'color', 'noprocess',
'notbstat' 'dbstat', 'nodbstat',
'tbstat', 'notbstat',
'sysstat', 'nosysstat',
'pfstat', 'nopfstat',
'idxstat', 'noidxstat',
) )
or pod2usage( or pod2usage(
-exitval => 1, -exitval => 1,
@ -185,9 +192,16 @@ if ( $opt{verbose} ) {
$opt{pfstat} = 1; #Print performance schema info. $opt{pfstat} = 1; #Print performance schema info.
$opt{cvefile} = 'vulnerabilities.csv'; #CVE File for vulnerability checks $opt{cvefile} = 'vulnerabilities.csv'; #CVE File for vulnerability checks
} }
$opt{nocolor} = 1 if defined($opt{outputfile}); $opt{nocolor} = 1 if defined( $opt{outputfile} );
$opt{tbstat} = 1 if ($opt{notbstat} != 0); # Don't Print database information $opt{tbstat} = 0 if ( $opt{notbstat} == 1 ); # Don't Print table information
$opt{dbstat} = 0 if ( $opt{nodbstat} == 1 ); # Don't Print database information
$opt{noprocess} = 0
if ( $opt{noprocess} == 1 ); # Don't Print process information
$opt{sysstat} = 0 if ( $opt{nosysstat} == 1 ); # Don't Print sysstat information
$opt{pfstat} = 0
if ( $opt{nopfstat} == 1 ); # Don't Print performance schema information
$opt{idxstat} = 0 if ( $opt{noidxstat} == 1 ); # Don't Print index information
# for RPM distributions # for RPM distributions
$opt{cvefile} = "/usr/share/mysqltuner/vulnerabilities.csv" $opt{cvefile} = "/usr/share/mysqltuner/vulnerabilities.csv"
unless ( defined $opt{cvefile} and -f "$opt{cvefile}" ); unless ( defined $opt{cvefile} and -f "$opt{cvefile}" );
@ -841,7 +855,8 @@ sub mysql_setup {
return 1; return 1;
} }
else { else {
badprint "Attempted to use login credentials from Debian maintenance account, but they failed."; badprint
"Attempted to use login credentials from Debian maintenance account, but they failed.";
exit 1; exit 1;
} }
} }
@ -963,10 +978,9 @@ sub select_array {
} }
sub human_size { sub human_size {
my( $size, $n ) =( shift, 0 ); my ( $size, $n ) = ( shift, 0 );
++$n and $size /= 1024 until $size < 1024; ++$n and $size /= 1024 until $size < 1024;
return sprintf "%.2f %s", return sprintf "%.2f %s", $size, (qw[ bytes KB MB GB ])[$n];
$size, ( qw[ bytes KB MB GB ] )[ $n ];
} }
# MySQL Request one # MySQL Request one
@ -1080,13 +1094,13 @@ sub get_all_vars {
push( @mysqlstatlist, select_array("SHOW GLOBAL STATUS") ); push( @mysqlstatlist, select_array("SHOW GLOBAL STATUS") );
arr2hash( \%mystat, \@mysqlstatlist ); arr2hash( \%mystat, \@mysqlstatlist );
$result{'Status'} = \%mystat; $result{'Status'} = \%mystat;
unless( defined ($myvar{'innodb_support_xa'}) ) { unless ( defined( $myvar{'innodb_support_xa'} ) ) {
$myvar{'innodb_support_xa'}='ON'; $myvar{'innodb_support_xa'} = 'ON';
} }
$myvar{'have_galera'} = "NO"; $myvar{'have_galera'} = "NO";
if ( defined( $myvar{'wsrep_provider_options'} ) if ( defined( $myvar{'wsrep_provider_options'} )
&& $myvar{'wsrep_provider_options'} ne "" && $myvar{'wsrep_provider_options'} ne ""
&& $myvar{'wsrep_on'} ne "OFF" ) && $myvar{'wsrep_on'} ne "OFF" )
{ {
$myvar{'have_galera'} = "YES"; $myvar{'have_galera'} = "YES";
@ -1373,6 +1387,7 @@ sub get_process_memory {
} }
sub get_other_process_memory { sub get_other_process_memory {
return 0 if ( $opt{tbstat} == 0 );
my @procs = `ps eaxo pid,command`; my @procs = `ps eaxo pid,command`;
@procs = map { @procs = map {
my $v = $_; my $v = $_;
@ -1630,7 +1645,7 @@ sub get_system_info {
infoprint "System Uptime : "; infoprint "System Uptime : ";
infocmd_tab "uptime"; infocmd_tab "uptime";
$result{'OS'}{'Uptime'}= `uptime`; $result{'OS'}{'Uptime'} = `uptime`;
} }
sub system_recommendations { sub system_recommendations {
@ -1709,11 +1724,12 @@ sub system_recommendations {
sub security_recommendations { sub security_recommendations {
subheaderprint "Security Recommendations"; subheaderprint "Security Recommendations";
if ( mysql_version_eq(8) ) { if ( mysql_version_eq(8) ) {
infoprint "Skipped due to unsupported feature for MySQL 8"; infoprint "Skipped due to unsupported feature for MySQL 8";
return; return;
} }
#exit 0; #exit 0;
if ( $opt{skippassword} eq 1 ) { if ( $opt{skippassword} eq 1 ) {
infoprint "Skipped due to --skippassword option"; infoprint "Skipped due to --skippassword option";
@ -1912,7 +1928,7 @@ sub get_replication_status {
"This replication slave is not running but seems to be configured."; "This replication slave is not running but seems to be configured.";
} }
if ( defined($io_running) if ( defined($io_running)
&& $io_running =~ /yes/i && $io_running =~ /yes/i
&& $sql_running =~ /yes/i ) && $sql_running =~ /yes/i )
{ {
if ( $myvar{'read_only'} eq 'OFF' ) { if ( $myvar{'read_only'} eq 'OFF' ) {
@ -1958,8 +1974,10 @@ sub validate_mysql_version {
# Checks if MySQL version is equal to (major, minor, micro) # Checks if MySQL version is equal to (major, minor, micro)
sub mysql_version_eq { sub mysql_version_eq {
my ( $maj, $min, $mic ) = @_; my ( $maj, $min, $mic ) = @_;
return int($mysqlvermajor) == int($maj) if ( !defined($min) && !defined($mic)); return int($mysqlvermajor) == int($maj)
return int($mysqlvermajor) == int($maj)&& int($mysqlverminor) == int($min) if ( !defined($mic)); if ( !defined($min) && !defined($mic) );
return int($mysqlvermajor) == int($maj) && int($mysqlverminor) == int($min)
if ( !defined($mic) );
return ( int($mysqlvermajor) == int($maj) return ( int($mysqlvermajor) == int($maj)
&& int($mysqlverminor) == int($min) && int($mysqlverminor) == int($min)
&& int($mysqlvermicro) == int($mic) ); && int($mysqlvermicro) == int($mic) );
@ -2190,7 +2208,7 @@ sub check_storage_engines {
debugprint "Data dump " . Dumper(@$tbl); debugprint "Data dump " . Dumper(@$tbl);
my ( $engine, $size, $datafree ) = @$tbl; my ( $engine, $size, $datafree ) = @$tbl;
next if $engine eq 'NULL'; next if $engine eq 'NULL';
$size = 0 if $size eq 'NULL'; $size = 0 if $size eq 'NULL';
$datafree = 0 if $datafree eq 'NULL'; $datafree = 0 if $datafree eq 'NULL';
if ( defined $enginestats{$engine} ) { if ( defined $enginestats{$engine} ) {
$enginestats{$engine} += $size; $enginestats{$engine} += $size;
@ -2374,6 +2392,7 @@ sub calculations {
$mycalc{'server_buffers'} + $mycalc{'server_buffers'} +
$mycalc{"max_total_per_thread_buffers"} + $mycalc{"max_total_per_thread_buffers"} +
get_pf_memory(); get_pf_memory();
# + get_gcache_memory(); # + get_gcache_memory();
$mycalc{'pct_max_used_memory'} = $mycalc{'pct_max_used_memory'} =
percentage( $mycalc{'max_used_memory'}, $physical_memory ); percentage( $mycalc{'max_used_memory'}, $physical_memory );
@ -2384,7 +2403,8 @@ sub calculations {
$mycalc{'server_buffers'} + $mycalc{'server_buffers'} +
$mycalc{'total_per_thread_buffers'} + $mycalc{'total_per_thread_buffers'} +
get_pf_memory(); get_pf_memory();
# + get_gcache_memory();
# + get_gcache_memory();
$mycalc{'pct_max_physical_memory'} = $mycalc{'pct_max_physical_memory'} =
percentage( $mycalc{'max_peak_memory'}, $physical_memory ); percentage( $mycalc{'max_peak_memory'}, $physical_memory );
@ -2429,7 +2449,7 @@ sub calculations {
$myvar{'key_cache_block_size'} $myvar{'key_cache_block_size'}
) / $myvar{'key_buffer_size'} ) / $myvar{'key_buffer_size'}
) )
) * 100 ) * 100
); );
} }
else { else {
@ -2512,20 +2532,21 @@ sub calculations {
# Query cache # Query cache
if ( mysql_version_ge(8) and mysql_version_le(10) ) { if ( mysql_version_ge(8) and mysql_version_le(10) ) {
$mycalc{'query_cache_efficiency'} = 0; $mycalc{'query_cache_efficiency'} = 0;
} elsif ( mysql_version_ge(4) ) { }
elsif ( mysql_version_ge(4) ) {
$mycalc{'query_cache_efficiency'} = sprintf( $mycalc{'query_cache_efficiency'} = sprintf(
"%.1f", "%.1f",
( (
$mystat{'Qcache_hits'} / $mystat{'Qcache_hits'} /
( $mystat{'Com_select'} + $mystat{'Qcache_hits'} ) ( $mystat{'Com_select'} + $mystat{'Qcache_hits'} )
) * 100 ) * 100
); );
if ( $myvar{'query_cache_size'} ) { if ( $myvar{'query_cache_size'} ) {
$mycalc{'pct_query_cache_used'} = sprintf( $mycalc{'pct_query_cache_used'} = sprintf(
"%.1f", "%.1f",
100 - ( 100 - (
$mystat{'Qcache_free_memory'} / $myvar{'query_cache_size'} $mystat{'Qcache_free_memory'} / $myvar{'query_cache_size'}
) * 100 ) * 100
); );
} }
if ( $mystat{'Qcache_lowmem_prunes'} == 0 ) { if ( $mystat{'Qcache_lowmem_prunes'} == 0 ) {
@ -2724,17 +2745,15 @@ sub mysql_stats {
infoprint "Max MySQL memory : " . hr_bytes( $mycalc{'max_peak_memory'} ); infoprint "Max MySQL memory : " . hr_bytes( $mycalc{'max_peak_memory'} );
infoprint "Other process memory: " . hr_bytes( get_other_process_memory() ); infoprint "Other process memory: " . hr_bytes( get_other_process_memory() );
#print hr_bytes( $mycalc{'server_buffers'} );
infoprint "Total buffers: " infoprint "Total buffers: "
. hr_bytes( $mycalc{'server_buffers'} ) . hr_bytes( $mycalc{'server_buffers'} )
. " 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 "P_S Max memory usage: " . hr_bytes_rnd( get_pf_memory() ); infoprint "P_S Max memory usage: " . hr_bytes_rnd( get_pf_memory() );
$result{'P_S'}{'memory'} = get_other_process_memory(); $result{'P_S'}{'memory'} = get_pf_memory();
$result{'P_S'}{'pretty_memory'} = $result{'P_S'}{'pretty_memory'} =
hr_bytes_rnd( get_other_process_memory() ); hr_bytes_rnd( get_pf_memory() );
infoprint "Galera GCache Max memory usage: " infoprint "Galera GCache Max memory usage: "
. hr_bytes_rnd( get_gcache_memory() ); . hr_bytes_rnd( get_gcache_memory() );
$result{'Galera'}{'GCache'}{'memory'} = get_gcache_memory(); $result{'Galera'}{'GCache'}{'memory'} = get_gcache_memory();
@ -2750,7 +2769,7 @@ sub mysql_stats {
if ( defined $myvar{'query_cache_type'} ) { if ( defined $myvar{'query_cache_type'} ) {
infoprint "Query Cache Buffers"; infoprint "Query Cache Buffers";
infoprint " +-- Query Cache: " infoprint " +-- Query Cache: "
. $myvar{'query_cache_type'} . " - " . $myvar{'query_cache_type'} . " - "
. ( . (
$myvar{'query_cache_type'} eq 0 | $myvar{'query_cache_type'} eq 0 |
@ -2901,12 +2920,14 @@ sub mysql_stats {
# Query cache # Query cache
if ( !mysql_version_ge(4) ) { if ( !mysql_version_ge(4) ) {
# MySQL versions < 4.01 don't support query caching # MySQL versions < 4.01 don't support query caching
push( @generalrec, push( @generalrec,
"Upgrade MySQL to version 4+ to utilize query caching" ); "Upgrade MySQL to version 4+ to utilize query caching" );
} }
elsif (mysql_version_eq(8)) { elsif ( mysql_version_eq(8) ) {
infoprint "Query cache have been removed in MySQL 8"; infoprint "Query cache have been removed in MySQL 8";
#return; #return;
} }
elsif ( $myvar{'query_cache_size'} < 1 elsif ( $myvar{'query_cache_size'} < 1
@ -3073,17 +3094,18 @@ sub mysql_stats {
if ( defined( $myvar{'thread_handling'} ) if ( defined( $myvar{'thread_handling'} )
and $myvar{'thread_handling'} eq 'pool-of-threads' ) and $myvar{'thread_handling'} eq 'pool-of-threads' )
{ {
# https://www.percona.com/doc/percona-server/LATEST/performance/threadpool.html # https://www.percona.com/doc/percona-server/LATEST/performance/threadpool.html
# When thread pool is enabled, the value of the thread_cache_size variable # When thread pool is enabled, the value of the thread_cache_size variable
# is ignored. The Threads_cached status variable contains 0 in this case. # is ignored. The Threads_cached status variable contains 0 in this case.
infoprint "Thread cache not used with thread_handling=pool-of-threads"; infoprint "Thread cache not used with thread_handling=pool-of-threads";
} }
else { else {
if ( $myvar{'thread_cache_size'} eq 0 ) { if ( $myvar{'thread_cache_size'} eq 0 ) {
badprint "Thread cache is disabled"; badprint "Thread cache is disabled";
push( @generalrec, "Set thread_cache_size to 4 as a starting value" ); push( @generalrec,
push( @adjvars, "thread_cache_size (start at 4)" ); "Set thread_cache_size to 4 as a starting value" );
} push( @adjvars, "thread_cache_size (start at 4)" );
}
else { else {
if ( $mycalc{'thread_cache_hit_rate'} <= 50 ) { if ( $mycalc{'thread_cache_hit_rate'} <= 50 ) {
badprint badprint
@ -3134,7 +3156,8 @@ sub mysql_stats {
. " over 64: http://bit.ly/1mi7c4C" ); . " over 64: http://bit.ly/1mi7c4C" );
push( @generalrec, push( @generalrec,
"Read this before increasing for MariaDB" "Read this before increasing for MariaDB"
. " https://mariadb.com/kb/en/library/optimizing-table_open_cache/"); . " https://mariadb.com/kb/en/library/optimizing-table_open_cache/"
);
push( @generalrec, push( @generalrec,
"This is MyISAM only table_cache scalability problem, InnoDB not affected." "This is MyISAM only table_cache scalability problem, InnoDB not affected."
); );
@ -5171,8 +5194,9 @@ sub mariadb_galera {
} }
infoprint "GCache is using " infoprint "GCache is using "
. hr_bytes_rnd( get_wsrep_option('gcache.mem_size') ); . hr_bytes_rnd( get_wsrep_option('gcache.mem_size') );
#my @primaryKeysNbTables=();
my @primaryKeysNbTables = select_array( #my @primaryKeysNbTables=();
my @primaryKeysNbTables = select_array(
"Select CONCAT(c.table_schema,CONCAT('.', c.table_name)) "Select CONCAT(c.table_schema,CONCAT('.', c.table_name))
from information_schema.columns c from information_schema.columns c
join information_schema.tables t using (TABLE_SCHEMA, TABLE_NAME) join information_schema.tables t using (TABLE_SCHEMA, TABLE_NAME)
@ -5182,15 +5206,14 @@ group by c.table_schema,c.table_name
having sum(if(c.column_key in ('PRI','UNI'), 1,0)) = 0" having sum(if(c.column_key in ('PRI','UNI'), 1,0)) = 0"
); );
infoprint "CPU core detected : " . (cpu_cores);
infoprint "CPU core detected : ". (cpu_cores); infoprint "wsrep_slave_threads: " . get_wsrep_option('wsrep_slave_threads');
infoprint "wsrep_slave_threads: ". get_wsrep_option('wsrep_slave_threads'); if ( get_wsrep_option('wsrep_slave_threads') > ( (cpu_cores) * 4 )
if ( get_wsrep_option('wsrep_slave_threads') > ((cpu_cores) * 4) 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 number of CPU(s)"; "wsrep_slave_threads is not equal to 2, 3 or 4 times number of CPU(s)";
push @adjvars, "wsrep_slave_threads = ".((cpu_cores) * 4); push @adjvars, "wsrep_slave_threads = " . ( (cpu_cores) * 4 );
} }
else { else {
goodprint goodprint
@ -5736,17 +5759,19 @@ sub mysql_innodb {
sub check_metadata_perf { sub check_metadata_perf {
subheaderprint "Analysis Performance Metrics"; subheaderprint "Analysis Performance Metrics";
infoprint "innodb_stats_on_metadata: ".$myvar{'innodb_stats_on_metadata'}; infoprint "innodb_stats_on_metadata: " . $myvar{'innodb_stats_on_metadata'};
if ($myvar{'innodb_stats_on_metadata'} eq 'ON') { if ( $myvar{'innodb_stats_on_metadata'} eq 'ON' ) {
badprint "Stat are updated during querying INFORMATION_SCHEMA."; badprint "Stat are updated during querying INFORMATION_SCHEMA.";
push @adjvars, "SET innodb_stats_on_metadata = OFF"; push @adjvars, "SET innodb_stats_on_metadata = OFF";
#Disabling innodb_stats_on_metadata
#Disabling innodb_stats_on_metadata
select_one("SET GLOBAL innodb_stats_on_metadata = OFF;"); select_one("SET GLOBAL innodb_stats_on_metadata = OFF;");
return 1; return 1;
} }
goodprint "No stat updates during querying INFORMATION_SCHEMA."; goodprint "No stat updates during querying INFORMATION_SCHEMA.";
return 0 return 0;
} }
# Recommendations for Database metrics # Recommendations for Database metrics
sub mysql_databases { sub mysql_databases {
return if ( $opt{dbstat} == 0 ); return if ( $opt{dbstat} == 0 );
@ -6197,29 +6222,30 @@ sub dump_result {
open my $fh, q(>), $opt{'reportfile'} open my $fh, q(>), $opt{'reportfile'}
or die or die
"Unable to open $opt{'reportfile'} in write mode. please check permissions for this file or directory"; "Unable to open $opt{'reportfile'} in write mode. please check permissions for this file or directory";
$template->fill_in( HASH => $vars, OUTPUT => $fh ); $template->fill_in( HASH => $vars, OUTPUT => $fh );
close $fh; close $fh;
} }
if ( $opt{'json'} ne 0 ) { if ( $opt{'json'} ne 0 ) {
eval { require JSON }; eval { require JSON };
if ($@) { if ($@) {
print "$bad JSON Module is needed.\n"; print "$bad JSON Module is needed.\n";
return 1; return 1;
} }
my $json = JSON->new->allow_nonref; my $json = JSON->new->allow_nonref;
print $json->utf8(1)->pretty( ( $opt{'prettyjson'} ? 1 : 0 ) )->encode( \%result ); print $json->utf8(1)->pretty( ( $opt{'prettyjson'} ? 1 : 0 ) )
->encode( \%result );
if ( $opt{'outputfile'} ne 0 ) { if ( $opt{'outputfile'} ne 0 ) {
unlink $opt{'outputfile'} if (-e $opt{'outputfile'}); unlink $opt{'outputfile'} if ( -e $opt{'outputfile'} );
open my $fh, q(>), $opt{'outputfile'} open my $fh, q(>), $opt{'outputfile'}
or die or die
"Unable to open $opt{'outputfile'} in write mode. please check permissions for this file or directory"; "Unable to open $opt{'outputfile'} in write mode. please check permissions for this file or directory";
print $fh $json->utf8(1)->pretty( ( $opt{'prettyjson'} ? 1 : 0 ) )->encode( \%result ); print $fh $json->utf8(1)->pretty( ( $opt{'prettyjson'} ? 1 : 0 ) )
close $fh; ->encode( \%result );
close $fh;
} }
} }
} }
@ -6257,22 +6283,23 @@ system_recommendations; # avoid to many service on the same host
log_file_recommendations; # check log file content log_file_recommendations; # check log file content
check_storage_engines; # Show enabled storage engines check_storage_engines; # Show enabled storage engines
check_metadata_perf; # Show parameter impacting performance during analysis check_metadata_perf; # Show parameter impacting performance during analysis
mysql_databases; # Show informations about databases mysql_databases; # Show informations about databases
mysql_tables; # Show informations about table column mysql_tables; # Show informations about table column
mysql_indexes; # Show informations about indexes
security_recommendations; # Display some security recommendations
cve_recommendations; # Display related CVE
calculations; # Calculate everything we need
mysql_stats; # Print the server stats
mysqsl_pfs; # Print Performance schema info
mariadb_threadpool; # Print MariaDB ThreadPool stats
mysql_myisam; # Print MyISAM stats
mysql_innodb; # Print InnoDB stats
mariadb_ariadb; # Print MariaDB AriaDB stats
mariadb_tokudb; # Print MariaDB Tokudb stats
mariadb_xtradb; # Print MariaDB XtraDB stats
mysql_indexes; # Show informations about indexes
security_recommendations; # Display some security recommendations
cve_recommendations; # Display related CVE
calculations; # Calculate everything we need
mysql_stats; # Print the server stats
mysqsl_pfs; # Print Performance schema info
mariadb_threadpool; # Print MariaDB ThreadPool stats
mysql_myisam; # Print MyISAM stats
mysql_innodb; # Print InnoDB stats
mariadb_ariadb; # Print MariaDB AriaDB stats
mariadb_tokudb; # Print MariaDB Tokudb stats
mariadb_xtradb; # Print MariaDB XtraDB stats
#mariadb_rockdb; # Print MariaDB RockDB stats #mariadb_rockdb; # Print MariaDB RockDB stats
#mariadb_spider; # Print MariaDB Spider stats #mariadb_spider; # Print MariaDB Spider stats
#mariadb_connect; # Print MariaDB Connect stats #mariadb_connect; # Print MariaDB Connect stats
@ -6295,7 +6322,7 @@ __END__
=head1 NAME =head1 NAME
MySQLTuner 1.7.13 - MySQL High Performance Tuning Script MySQLTuner 1.7.14 - MySQL High Performance Tuning Script
=head1 IMPORTANT USAGE GUIDELINES =head1 IMPORTANT USAGE GUIDELINES
@ -6336,12 +6363,19 @@ You must provide the remote server's total memory when connecting to other serve
--nobad Remove negative/suggestion responses --nobad Remove negative/suggestion responses
--noinfo Remove informational responses --noinfo Remove informational responses
--debug Print debug information --debug Print debug information
--noprocess Consider no other process is running
--dbstat Print database information --dbstat 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
--idxstat Print index information --idxstat Print index information
--noidxstat Don't Print index information
--sysstat Print system information --sysstat Print system information
--nosysstat Don't Print system information
--pfstat Print Performance schema --pfstat Print Performance schema
--nopfstat Don't Print Performance schema
--verbose Prints out all options (default: no verbose, dbstat, idxstat, sysstat, tbstat, pfstat)
--bannedports Ports banned separated by comma(,) --bannedports Ports banned separated by comma(,)
--maxportallowed Number of ports opened allowed on this hosts --maxportallowed Number of ports opened allowed on this hosts
--cvefile <path> CVE File for vulnerability checks --cvefile <path> CVE File for vulnerability checks
@ -6351,7 +6385,7 @@ You must provide the remote server's total memory when connecting to other serve
--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
--template <path> Path to a template file --template <path> Path to a template file
--verbose Prints out all options (default: no verbose)
=head1 PERLDOC =head1 PERLDOC
@ -6528,7 +6562,7 @@ L<https://github.com/major/MySQLTuner-perl>
=head1 COPYRIGHT AND LICENSE =head1 COPYRIGHT AND LICENSE
Copyright (C) 2006-2017 Major Hayden - major@mhtx.net Copyright (C) 2006-2018 Major Hayden - major@mhtx.net
For the latest updates, please visit http://mysqltuner.com/ For the latest updates, please visit http://mysqltuner.com/