From 246f03b46100dc42b588b6a53b70312b8149ad70 Mon Sep 17 00:00:00 2001 From: BigEd Date: Mon, 9 Oct 2023 14:47:25 +0100 Subject: [PATCH] fixup count of physical cores in discourse-setup (#739) See also PR #702 for branch master --- discourse-setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discourse-setup b/discourse-setup index 0daafcbe6..d90002c37 100755 --- a/discourse-setup +++ b/discourse-setup @@ -257,7 +257,7 @@ scale_ram_and_cpu() { avail_cores=`sysctl hw.ncpu | awk '/hw.ncpu:/ {print $2}'` else avail_gb=$(check_linux_memory) - avail_cores=$((`awk '/cpu cores/ {print $4;exit}' /proc/cpuinfo`*`sort /proc/cpuinfo | uniq | grep -c "physical id"`)) + avail_cores=`lscpu --parse=core | egrep -v ^# | sort -u | wc -l` fi echo "Found ${avail_gb}GB of memory and $avail_cores physical CPU cores"