From 2f3832b6f7370c231428be14c7a362a7452d7286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AC=9D=E8=87=B4=E9=82=A6=20=28XIE=20Zhibang=29?= Date: Wed, 19 Apr 2017 20:01:02 +0800 Subject: [PATCH 1/2] The query cache should be disabled in MariaDB 10.1 --- mysqltuner.pl | 1 - 1 file changed, 1 deletion(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 3778018..0fd5f86 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -2800,7 +2800,6 @@ sub mysql_stats { "Upgrade MySQL to version 4+ to utilize query caching" ); } elsif ( mysql_version_ge( 5, 5 ) - and !mysql_version_ge( 10, 1 ) and $myvar{'query_cache_type'} eq "OFF" ) { goodprint From f4a108c2f6b78a994e5abb133c7f319116c33c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AC=9D=E8=87=B4=E9=82=A6=20=28XIE=20Zhibang=29?= Date: Wed, 19 Apr 2017 21:25:45 +0800 Subject: [PATCH 2/2] Disable query cache. --- mysqltuner.pl | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 0fd5f86..a7333b8 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -2799,20 +2799,12 @@ sub mysql_stats { push( @generalrec, "Upgrade MySQL to version 4+ to utilize query caching" ); } - elsif ( mysql_version_ge( 5, 5 ) + elsif ( $myvar{'query_cache_size'} < 1 and $myvar{'query_cache_type'} eq "OFF" ) { goodprint "Query cache is disabled by default due to mutex contention on multiprocessor machines."; } - elsif ( $myvar{'query_cache_size'} < 1 ) { - badprint "Query cache is disabled"; - push( @adjvars, "query_cache_size (>= 8M)" ); - } - elsif ( $myvar{'query_cache_type'} eq "OFF" ) { - badprint "Query cache is disabled"; - push( @adjvars, "query_cache_type (=1)" ); - } elsif ( $mystat{'Com_select'} == 0 ) { badprint "Query cache cannot be analyzed - no SELECT statements executed"; @@ -2820,6 +2812,7 @@ sub mysql_stats { else { badprint "Query cache may be disabled by default due to mutex contention."; + push( @adjvars, "query_cache_size (=0)" ); push( @adjvars, "query_cache_type (=0)" ); if ( $mycalc{'query_cache_efficiency'} < 20 ) { badprint