In the Linux operating system, the CPU information is loaded into the Cpuinfo file under the virtual directory/proc in the boot process, and we can view it through Cat/proc/cpuinfo:
Is my computer CPU information, below we analyze some of the more important indicators:
- processor The ID of the logical processor.
- ID of the processor that physical ID physically encapsulates.
- The ID of the core ID for each key.
- CPU Cores The number of cores in the same physically encapsulated processor.
- siblings The number of logical processors in the same physically encapsulated processor.
We go back to see, my physical ID is 0, indicating that I have only one physical processor;
My processor has two different numbers and belongs to a physical ID, and the CPU cores has a value of 2, which means that my CPU is dual-core and that each core has only one logical processor.
To deepen our understanding of these parameters, let's look at another picture, which is a server for a workstation:
On this server, ' CPU cores ' for 4,physical ID has two, core ID has 8, siblings value is 8, a total of 16 processor.
so this server host CPU is 2 physically packaged processors, each processor has 4 processing cores (CPU cores), each CPU core can be divided into 2 logical processors (Hyper-Threading technology), so there are 8 logical processors on each physical processor, A total of 16 processor. this time you understand. The general structure is as follows:
Instruction Summary:
View all CPU information: $cat/proc/cpuinfo
To view the ID information for the physical CPU Processor: $cat/proc/cpuinfo | grep "Physical ID" | Sort-n | Uniq
To view the number of physical CPU processors: $cat/proc/cpuinfo | grep "Physical ID" | Sort-n | Uniq | Wc-l
View core information for each physical CPU Processor: $cat/proc/cpuinfo | grep "CPU Cores" | Sort-n | Uniq
This will know the number of physical CPU processors and the number of cores per physical CPU
To view the ID information for a logical CPU Processor: $cat/proc/cpuinfo | grep "Processor"
To view the total number of logical CPU processors: $cat/proc/cpuinfo | grep "Processor" | Wc-l
View the number of logical CPU processors for each physical CPU Processor: $cat/proc/cpuinfo | grep "Sibling" | Sort-n | Uniq
View CPU information under Linux