From: Teemu Heikkilä Date: Fri, 28 Oct 2016 18:37:46 +0000 (+0300) Subject: Fix physical core calculation X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=965686730d277f45636d030c17be9046dab77793;p=discourse_docker.git Fix physical core calculation --- diff --git a/discourse-setup b/discourse-setup index 8026da0..45c7696 100755 --- a/discourse-setup +++ b/discourse-setup @@ -134,8 +134,8 @@ scale_ram_and_cpu() { avail_gb=$(check_osx_memory) avail_cores=`sysctl hw.ncpu | awk '/hw.ncpu:/ {print $2}'` else - avail_gb=$(check_linux_memory) - avail_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | awk '{print $4}'` + avail_gb=$(check_linux_memory) + avail_cores=$((`awk '/cpu cores/ {print $4;exit}' /proc/cpuinfo`*`sort /proc/cpuinfo | uniq | grep -c "physical id"`)) fi echo "Found ${avail_gb}GB of memory and $avail_cores physical CPU cores"