Skip to content

Commit

Permalink
MySQLTuner dont understand Thread Pool in Percona Server 5.7 #386
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrenouard committed Sep 26, 2018
1 parent b8224be commit dab1e7e
Showing 1 changed file with 29 additions and 14 deletions.
43 changes: 29 additions & 14 deletions mysqltuner.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
# mysqltuner.pl - Version 1.7.12
# mysqltuner.pl - Version 1.7.13
# High Performance MySQL Tuning Script
# Copyright (C) 2006-2018 Major Hayden - major@mhtx.net
#
Expand Down Expand Up @@ -56,7 +56,7 @@ package main;
#use Env;

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

# Set defaults
Expand Down Expand Up @@ -3070,17 +3070,32 @@ sub mysql_stats {
}

# Thread cache
if ( $myvar{'thread_cache_size'} eq 0 ) {
badprint "Thread cache is disabled";
push( @generalrec, "Set thread_cache_size to 4 as a starting value" );
push( @adjvars, "thread_cache_size (start at 4)" );
}
else {
if ( defined( $myvar{'thread_handling'} )
and $myvar{'thread_handling'} eq 'pools-of-threads' )
{
infoprint "Thread cache hit rate: not used with pool-of-threads";
}
# if ( $myvar{'thread_cache_size'} eq 0 ) {
# badprint "Thread cache is disabled";
# push( @generalrec, "Set thread_cache_size to 4 as a starting value" );
# push( @adjvars, "thread_cache_size (start at 4)" );
# }
# else {
# if ( defined( $myvar{'thread_handling'} )
# and $myvar{'thread_handling'} eq 'pools-of-threads' )
# {
# infoprint "Thread cache hit rate: not used with pool-of-threads";
# }

if ( defined( $myvar{'thread_handling'} )
and $myvar{'thread_handling'} eq 'pool-of-threads' )
{
# https://www.percona.com/doc/percona-server/LATEST/performance/threadpool.html
# 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.
infoprint "Thread cache not used with thread_handling=pool-of-threads";
}
else {
if ( $myvar{'thread_cache_size'} eq 0 ) {
badprint "Thread cache is disabled";
push( @generalrec, "Set thread_cache_size to 4 as a starting value" );
push( @adjvars, "thread_cache_size (start at 4)" );
}
else {
if ( $mycalc{'thread_cache_hit_rate'} <= 50 ) {
badprint
Expand Down Expand Up @@ -6292,7 +6307,7 @@ sub which {
=head1 NAME
MySQLTuner 1.7.12 - MySQL High Performance Tuning Script
MySQLTuner 1.7.13 - MySQL High Performance Tuning Script
=head1 IMPORTANT USAGE GUIDELINES
Expand Down

0 comments on commit dab1e7e

Please sign in to comment.