Sunday, 20 August 2017

Accurately determine the number of CPU cores for a Linux machine


The number of processors shown by /proc/cpuinfo might not be the actual number of cores on the processor. For example a processor with 2 cores and hyperthreading would be reported as a processor with 4 cores. To get the actual number of cores, check the core id for unique values as follows:

cat /proc/cpuinfo | grep "core id" | sort -u 



No comments:

Post a Comment