From ffed6a3715422391f41147f8d2b64b729f9f03e5 Mon Sep 17 00:00:00 2001 From: Christine Date: Tue, 22 Mar 2016 15:20:18 +0100 Subject: [PATCH] Adding threadpool information #138 --- mysqltuner.pl | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 33ace26..771a215 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -785,7 +785,11 @@ sub get_all_vars { if ( ( $myvar{'ignore_builtin_innodb'} || "" ) eq "ON" ) { $myvar{'have_innodb'} = "NO"; } - + + $myvar{'have_threadpool'} = "NO"; + if ( defined ( $myvar{'thread_pool_size'} ) and $myvar{'thread_pool_size'} > 0 ) { + $myvar{'have_threadpool'} = "YES"; + } # have_* for engines is deprecated and will be removed in MySQL 5.6; # check SHOW ENGINES and set corresponding old style variables. # Also works around MySQL bug #59393 wrt. skip-innodb @@ -2503,13 +2507,33 @@ sub mariadb_threadpool { # AriaDB unless ( defined $myvar{'have_threadpool'} - && $myvar{'have_threadpool'} eq "YES" - && defined $enginestats{'Aria'} ) + && $myvar{'have_threadpool'} eq "YES" ) { infoprint "ThreadPool stat is disabled."; return; } - infoprint "ThreadPool stat is enabled."; + infoprint "ThreadPool stat is enabled."; + infoprint "Thread Pool Size: ".$myvar{'thread_pool_size'}. " thread(s)."; + + if ($myvar{'have_innodb'} eq 'YES') { + if ($myvar{'thread_pool_size'}< 16 or $myvar{'thread_pool_size'}>36) { + badprint "thread_pool_size between 16 and 36 when using InnoDB storage engine."; + push( @generalrec, "Thread pool size for InnoDB usage (".$myvar{'thread_pool_size'}.")" ); + push( @adjvars, "thread_pool_size between 16 and 36 for InnoDB usage" ); + } else { + goodprint "thread_pool_size between 16 and 36 when using InnoDB storage engine."; + } + return; + } + if ($myvar{'have_isam'} eq 'YES') { + if ($myvar{'thread_pool_size'}<4 or $myvar{'thread_pool_size'}>8) { + badprint "thread_pool_size between 4 and 8 when using MyIsam storage engine."; + push( @generalrec, "Thread pool size for MyIsam usage (".$myvar{'thread_pool_size'}.")" ); + push( @adjvars, "thread_pool_size between 4 and 8 for MyIsam usage" ); + } else { + goodprint "thread_pool_size between 4 and 8 when using MyISAM storage engine."; + } + } } # Recommendations for Performance Schema @@ -2525,6 +2549,7 @@ sub mysqsl_pfs { infoprint "Performance schema is enabled."; } + # Recommendations for Ariadb sub mariadb_ariadb { prettyprint