Number of physical CPU cores on linux servers. number of kernels. view the number of threads and detailed description of the relationship
The company's servers are purchased in several batches, so the configuration is not very similar, especially in terms of cpu configuration. I have been trying to figure out the model of These CPUs, and there are several physical CPUs, each cpu has several cores, but no core has several threads. It looks complicated. Let's take a thorough analysis.
I roughly looked at the company server model, which is easy to get
Run the command more/proc/cpuinfo | grep "model name" or dmidecode-s processor-version to obtain
Here I mainly have two types of CPUs: Intel (R) Xeon (R) cpu E5-2630 v2 @ 2.60 GHz, and Intel (R) Xeon (R) CPU E5620 @ 2.40 GHz
Let's take a look at the differences between the two types of CPUs.
Run the command to obtain the number of physical cores and threads of the cpu respectively.
Here we want to explain
The number of CPU cores refers to the number of physical CPUs physically, that is, the number of physical CPUs on the hardware, one represents one and two represent two cpu processors.
Number of cores: a core is a physical thread. Intel has a hyper-threading technology that can simulate a physical thread to use two threads to give full play to the CPU performance, it means that a core can have multiple threads.
Thread Count: the number of threads is a logical concept. Simply put, it is the number of CPU cores simulated. For example, a two-thread CPU can be simulated by the number of CPU cores, that is, the single-core CPU is simulated into a function similar to the dual-core CPU.
1. view the number of physical CPUs
Grep 'physical id'/proc/cpuinfo | sort-u | wc-l
2. view the number of cores
Grep 'core id'/proc/cpuinfo | sort-u | wc-l
3. view the number of threads
Grep 'processor '/proc/cpuinfo | sort-u | wc-l
Intel (R) Xeon (R) CPU E5620 data
Intel (R) Xeon (R) CPU E5-2630 v2 data
The final result is as follows:
Here we can see the difference between the two CPUs.
E5620 is a physical cpu with a total of 4 cores and 8 threads, that is, two threads for each core.
E5-2630 is two physical CPUs with 6 cores and 24 threads in total.