create a dedicated sub for innodb
This commit is contained in:
parent
0e66f16b05
commit
9d619be2e2
1 changed files with 58 additions and 42 deletions
|
@ -1140,8 +1140,22 @@ sub mysql_stats {
|
||||||
push(@generalrec,"Your applications are not closing MySQL connections properly");
|
push(@generalrec,"Your applications are not closing MySQL connections properly");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
# Recommandations for Innodb
|
||||||
|
sub mysql_innodb {
|
||||||
|
prettyprint "\n-------- InnoDB Metrics -----------------------------------------------------\n";
|
||||||
# InnoDB
|
# InnoDB
|
||||||
if (defined $myvar{'have_innodb'} && $myvar{'have_innodb'} eq "YES" && defined $enginestats{'InnoDB'}) {
|
unless (defined $myvar{'have_innodb'} && $myvar{'have_innodb'} eq "YES" && defined $enginestats{'InnoDB'}) {
|
||||||
|
infoprint "InnoDB is disabled.";
|
||||||
|
if (mysql_version_ge(5,5)) {
|
||||||
|
badprint "InnoDB Storage engine is disabled. InnoDB is the default storage engine\n";
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
infoprint "InnoDB is enabled.\n";
|
||||||
|
infoprint "InnoDB BufferPool Size :".hr_bytes($myvar{'innodb_buffer_pool_size'})."\n";
|
||||||
|
infoprint "InnoDB BufferPool Inst :".$myvar{'innodb_buffer_pool_instances'}."\n" if defined($myvar{'innodb_buffer_pool_instances'});
|
||||||
# InnoDB Buffer Pull Size
|
# InnoDB Buffer Pull Size
|
||||||
if ($myvar{'innodb_buffer_pool_size'} > $enginestats{'InnoDB'}) {
|
if ($myvar{'innodb_buffer_pool_size'} > $enginestats{'InnoDB'}) {
|
||||||
goodprint "InnoDB buffer pool / data size: ".hr_bytes($myvar{'innodb_buffer_pool_size'})."/".hr_bytes($enginestats{'InnoDB'})."\n";
|
goodprint "InnoDB buffer pool / data size: ".hr_bytes($myvar{'innodb_buffer_pool_size'})."/".hr_bytes($enginestats{'InnoDB'})."\n";
|
||||||
|
@ -1149,13 +1163,15 @@ sub mysql_stats {
|
||||||
badprint "InnoDB buffer pool / data size: ".hr_bytes($myvar{'innodb_buffer_pool_size'})."/".hr_bytes($enginestats{'InnoDB'})."\n";
|
badprint "InnoDB buffer pool / data size: ".hr_bytes($myvar{'innodb_buffer_pool_size'})."/".hr_bytes($enginestats{'InnoDB'})."\n";
|
||||||
push(@adjvars,"innodb_buffer_pool_size (>= ".hr_bytes_rnd($enginestats{'InnoDB'}).")");
|
push(@adjvars,"innodb_buffer_pool_size (>= ".hr_bytes_rnd($enginestats{'InnoDB'}).")");
|
||||||
}
|
}
|
||||||
|
|
||||||
# InnoDB Buffer Pull Instances (MySQL 5.6.6+)
|
# InnoDB Buffer Pull Instances (MySQL 5.6.6+)
|
||||||
if (defined($myvar{'innodb_buffer_pool_instances'})) {
|
if (defined($myvar{'innodb_buffer_pool_instances'})) {
|
||||||
# Bad Value if > 64
|
# Bad Value if > 64
|
||||||
if ($myvar{'innodb_buffer_pool_instances'} > 64) {
|
if ($myvar{'innodb_buffer_pool_instances'} > 64) {
|
||||||
badprint "InnoDB buffer pool instances: ".$myvar{'innodb_buffer_pool_instances'}."\n";
|
badprint "InnoDB buffer pool instances: ".$myvar{'innodb_buffer_pool_instances'}."\n";
|
||||||
push(@adjvars,"innodb_buffer_pool_instances (<= 64)");
|
push(@adjvars,"innodb_buffer_pool_instances (<= 64)");
|
||||||
} else {
|
}
|
||||||
|
|
||||||
# InnoDB Buffer Pull Size > 1Go
|
# InnoDB Buffer Pull Size > 1Go
|
||||||
if ($myvar{'innodb_buffer_pool_size'} > 1024*1024*1024
|
if ($myvar{'innodb_buffer_pool_size'} > 1024*1024*1024
|
||||||
and $myvar{'innodb_buffer_pool_instances'} != int($myvar{'innodb_buffer_pool_size'}/(1024*1024*1024))
|
and $myvar{'innodb_buffer_pool_instances'} != int($myvar{'innodb_buffer_pool_size'}/(1024*1024*1024))
|
||||||
|
@ -1170,8 +1186,9 @@ sub mysql_stats {
|
||||||
goodprint "InnoDB buffer pool instances: ".$myvar{'innodb_buffer_pool_instances'}."\n";
|
goodprint "InnoDB buffer pool instances: ".$myvar{'innodb_buffer_pool_instances'}."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
# InnoDB Log Waits
|
# InnoDB Log Waits
|
||||||
if (defined $mystat{'Innodb_log_waits'} && $mystat{'Innodb_log_waits'} > 0) {
|
if (defined $mystat{'Innodb_log_waits'} && $mystat{'Innodb_log_waits'} > 0) {
|
||||||
badprint "InnoDB log waits: ".$mystat{'Innodb_log_waits'};
|
badprint "InnoDB log waits: ".$mystat{'Innodb_log_waits'};
|
||||||
|
@ -1179,9 +1196,7 @@ sub mysql_stats {
|
||||||
} else {
|
} else {
|
||||||
goodprint "InnoDB log waits: ".$mystat{'Innodb_log_waits'}."\n";
|
goodprint "InnoDB log waits: ".$mystat{'Innodb_log_waits'}."\n";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Take the two recommendation arrays and display them at the end of the output
|
# Take the two recommendation arrays and display them at the end of the output
|
||||||
sub make_recommendations {
|
sub make_recommendations {
|
||||||
prettyprint "\n-------- Recommendations -----------------------------------------------------\n";
|
prettyprint "\n-------- Recommendations -----------------------------------------------------\n";
|
||||||
|
@ -1219,6 +1234,7 @@ check_storage_engines; # Show enabled storage engines
|
||||||
security_recommendations; # Display some security recommendations
|
security_recommendations; # Display some security recommendations
|
||||||
calculations; # Calculate everything we need
|
calculations; # Calculate everything we need
|
||||||
mysql_stats; # Print the server stats
|
mysql_stats; # Print the server stats
|
||||||
|
mysql_innodb; # Print InnoDB stats
|
||||||
make_recommendations; # Make recommendations based on stats
|
make_recommendations; # Make recommendations based on stats
|
||||||
close_reportfile; # Close reportfile if needed
|
close_reportfile; # Close reportfile if needed
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue