From 8347fafe4ece9d6ae1ca4beb6cc122047048b9b4 Mon Sep 17 00:00:00 2001 From: Marius Feraru Date: Fri, 21 Mar 2014 17:32:35 +0200 Subject: [PATCH] improve "$arch" variable usage - handle the (default!) undefined case; - really treat it as a number (cause that's the way it is defined everywhere in "check_architecture", and it is compared to a number too); - (try to) avoid extra ops by reordering the operations. --- mysqltuner.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 8b8128f..9475a24 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -763,7 +763,7 @@ sub mysql_stats { # Memory usage infoprint "Total buffers: ".hr_bytes($mycalc{'server_buffers'})." global + ".hr_bytes($mycalc{'per_thread_buffers'})." per thread ($myvar{'max_connections'} max threads)\n"; - if ($mycalc{'total_possible_used_memory'} > 2*1024*1024*1024 && $arch eq 32) { + if ($arch && $arch == 32 && $mycalc{'total_possible_used_memory'} > 2*1024*1024*1024) { badprint "Allocating > 2GB RAM on 32-bit systems can cause system instability\n"; badprint "Maximum possible memory usage: ".hr_bytes($mycalc{'total_possible_used_memory'})." ($mycalc{'pct_physical_memory'}% of installed RAM)\n"; } elsif ($mycalc{'pct_physical_memory'} > 85) {