Check the number of physical CPUs, cores, logical CPUs, and linuxcpu in linux.
I. First, we need to clarify the concept of the number of physical CPUs, the number of cores, and the number of logical CPUs.
1. Number of physical CPUs: the number of CPUs actually inserted on the motherboard. You can specify the number of unique physical IDS (physical id)
2. Number of cpu cores: Number of chipsets that can process data on a single CPU, such as dual-core and quad-core (cpu cores)
3. logical cpu count: In general, logical cpu = number of physical CPUs × number of each core. If they are not equal, the CPU of the server supports hyper-Threading Technology (HT: Simply put, it enables one kernel in the processor to play a role in the operating system as two kernels. In this way, the execution resources available for the operating system are doubled, greatly improving the overall performance of the system. At this time, the logical cpu = the number of physical CPUs × the number of each core x2)
(Processer 0-n)
2. View cpu information by viewing/proc/cpuinfo
1. Number of physical CPUs: [XXXX @ server ~] $ Grep 'physical id'/proc/cpuinfo | sort | uniq | wc-l
2. Number of cpu cores: [XXXX @ server ~] $ Grep 'cpu cores'/proc/cpuinfo | uniq | awk-F': ''{print $2 }'
3. Logical cpu: [XXXX @ server ~] $ Cat/proc/cpuinfo | grep "processor" | wc-l
We can see that my computer has a single cpu, 4 cores, and no hyper-threading.