Skip to content

Commit dab1e7e

Browse files
committed
MySQLTuner dont understand Thread Pool in Percona Server 5.7 #386
1 parent b8224be commit dab1e7e

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

mysqltuner.pl

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env perl
2-
# mysqltuner.pl - Version 1.7.12
2+
# mysqltuner.pl - Version 1.7.13
33
# High Performance MySQL Tuning Script
44
# Copyright (C) 2006-2018 Major Hayden - [email protected]
55
#
@@ -56,7 +56,7 @@ package main;
5656
#use Env;
5757

5858
# Set up a few variables for use in the script
59-
my $tunerversion = "1.7.12";
59+
my $tunerversion = "1.7.13";
6060
my ( @adjvars, @generalrec );
6161

6262
# Set defaults
@@ -3070,17 +3070,32 @@ sub mysql_stats {
30703070
}
30713071

30723072
# Thread cache
3073-
if ( $myvar{'thread_cache_size'} eq 0 ) {
3074-
badprint "Thread cache is disabled";
3075-
push( @generalrec, "Set thread_cache_size to 4 as a starting value" );
3076-
push( @adjvars, "thread_cache_size (start at 4)" );
3077-
}
3078-
else {
3079-
if ( defined( $myvar{'thread_handling'} )
3080-
and $myvar{'thread_handling'} eq 'pools-of-threads' )
3081-
{
3082-
infoprint "Thread cache hit rate: not used with pool-of-threads";
3083-
}
3073+
# if ( $myvar{'thread_cache_size'} eq 0 ) {
3074+
# badprint "Thread cache is disabled";
3075+
# push( @generalrec, "Set thread_cache_size to 4 as a starting value" );
3076+
# push( @adjvars, "thread_cache_size (start at 4)" );
3077+
# }
3078+
# else {
3079+
# if ( defined( $myvar{'thread_handling'} )
3080+
# and $myvar{'thread_handling'} eq 'pools-of-threads' )
3081+
# {
3082+
# infoprint "Thread cache hit rate: not used with pool-of-threads";
3083+
# }
3084+
3085+
if ( defined( $myvar{'thread_handling'} )
3086+
and $myvar{'thread_handling'} eq 'pool-of-threads' )
3087+
{
3088+
# https://www.percona.com/doc/percona-server/LATEST/performance/threadpool.html
3089+
# When thread pool is enabled, the value of the thread_cache_size variable
3090+
# is ignored. The Threads_cached status variable contains 0 in this case.
3091+
infoprint "Thread cache not used with thread_handling=pool-of-threads";
3092+
}
3093+
else {
3094+
if ( $myvar{'thread_cache_size'} eq 0 ) {
3095+
badprint "Thread cache is disabled";
3096+
push( @generalrec, "Set thread_cache_size to 4 as a starting value" );
3097+
push( @adjvars, "thread_cache_size (start at 4)" );
3098+
}
30843099
else {
30853100
if ( $mycalc{'thread_cache_hit_rate'} <= 50 ) {
30863101
badprint
@@ -6292,7 +6307,7 @@ sub which {
62926307
62936308
=head1 NAME
62946309
6295-
MySQLTuner 1.7.12 - MySQL High Performance Tuning Script
6310+
MySQLTuner 1.7.13 - MySQL High Performance Tuning Script
62966311
62976312
=head1 IMPORTANT USAGE GUIDELINES
62986313

0 commit comments

Comments
 (0)