Difference between revisions of "Get cpu count with bash script"

From DevOps Notebook
 
Line 11: Line 11:
 
fi
 
fi
 
echo "max session:" $MAXSESSIONS
 
echo "max session:" $MAXSESSIONS
</syntaxhighlight
+
</syntaxhighlight>

Latest revision as of 17:51, 27 January 2022

#!/bin/bash
CPUCOUNT=`cat /proc/cpuinfo  |grep processor |wc -l`
echo "CPU COUNT IS: " $CPUCOUNT

if [ $CPUCOUNT -lt "5" ]
then
	MAXSESSIONS="7"
else
	MAXSESSIONS="12"
fi
echo "max session:" $MAXSESSIONS