Add recommendation on table_definition_cache #433

This commit is contained in:
Jean-Marie Renouard 2019-10-03 21:29:03 +02:00
parent a421f73e26
commit 143b80b3a6
2 changed files with 18 additions and 0 deletions

View file

@ -167,6 +167,7 @@
* Thread cache (=4) * Thread cache (=4)
* Thread cache hit ratio (>50%) if thread_handling is different of pools-of-threads * Thread cache hit ratio (>50%) if thread_handling is different of pools-of-threads
* Table cache hit ratio(>2°%) * Table cache hit ratio(>2°%)
* Table cache definition should be upper that total number of tables or in autoresizing mode
* Percentage of open file and open file limit(<85%) * Percentage of open file and open file limit(<85%)
* Percentage of table locks (<95%) * Percentage of table locks (<95%)
* Percentage of binlog cache lock (<90%) * Percentage of binlog cache lock (<90%)

View file

@ -3238,6 +3238,23 @@ sub mysql_stats {
} }
} }
# Table definition cache
my $nbtables=select_one('SELECT COUNT(*) FROM information_schema.tables');
if ( defined $myvar{'table_definition_cache'} ) {
if ( $myvar{'table_definition_cache'} == -1 ) {
infoprint ("table_definition_cache(".$myvar{'table_definition_cache'} .") is in autosizing mode");
} elsif ($myvar{'table_definition_cache'} < $nbtables ) {
badprint "table_definition_cache(".$myvar{'table_definition_cache'} .") is lower than number of tables($nbtables) ";
push( @adjvars,
"table_definition_cache(".$myvar{'table_definition_cache'} .") > " . $$nbtables . " or -1 (autosizing if supported)" );
}
else {
goodprint "table_definition_cache(".$myvar{'table_definition_cache'} .") is upper than number of tables($nbtables)";
}
} else {
infoprint "No table_definition_cache variable found.";
}
# Open files # Open files
if ( defined $mycalc{'pct_files_open'} ) { if ( defined $mycalc{'pct_files_open'} ) {
if ( $mycalc{'pct_files_open'} > 85 ) { if ( $mycalc{'pct_files_open'} > 85 ) {