How to judge the number of physical cpus, cores and whether it supports hyperthreading under Linux

  Under the Linux system, you can use cat /proc/cpuinfo to view the relevant information of the CPU on the machine. The processor can determine the number of logical CPUs, the physical id can determine the number of physical CPUs, and the cpu cores can be used to determine the internal CPU of each CPU. The number of cores can be judged by comparing siblings and cpu cores whether hyperthreading is supported.
    [oracle@sany1 ~]$ cat /proc/cpuinfo |grep processor|wc -l
    32
    Through the above command, it can be judged that the number of logical CPUs in the machine is 32
    [oracle@sany1 ~]$ cat /proc/cpuinfo |grep physical \ id|sort|uniq
    physical id : 0
    physical id : 1
    Through the above output, it can be judged that the number of physical cpus in the machine is 2
    [oracle@sany1 ~]$ cat /proc/cpuinfo |grep cpu\ cores|uniq
    cpu cores : 8
    Through the above output, it can be judged that the number of cores of a single cpu is 8
    [root@sany1 ~]# cat /proc/cpuinfo |grep sibling|uniq
    siblings : 16
    Through the above output results and comparison with cpu cores, it can be determined that the machine supports super thread.
    From the above results, we can finally determine that the machine has 2 physical cpus, each cpu has 8 cores, and each core supports 2 threads. From the operating system, through monitoring commands such as top or mpstat, we can see that there are 32 logical cpu.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326886979&siteId=291194637