How to find the number of physical processors

The cat /proc/cpuinfo | egrep “processor|core|model name|physical id command will tell you what you need to know.

Here is what the command looks like when run on an Opteron server with 2-dual core CPU’s:

$ cat /proc/cpuinfo | egrep “processor|core|model name|physical id”
processor : 0
model name : AMD Opteron ™ Processor 880
physical id : 0
core id : 0
cpu cores : 2
processor : 1
model name : AMD Opteron ™ Processor 880
physical id : 0
core id : 1
cpu cores : 2
processor : 2
model name : AMD Opteron ™ Processor 880
physical id : 1
core id : 0
cpu cores : 2
processor : 3
model name : AMD Opteron ™ Processor 880
physical id : 1
core id : 1
cpu cores : 2

Notice that each listed dual-core processor will have the SAME physical ID, but a DIFFERENT core ID (0,1). A single- core hyper threaded CPU will list as two processors, but have the same physical ID and the same core ID.

Finally, four physical processors will list with different physical ID, like this:

processor : 0
model name : Intel(R) Xeon(TM) MP CPU 2.80GHz
physical id : 0

processor : 1
model name : Intel(R) Xeon(TM) MP CPU 2.80GHz
physical id : 1

processor : 2
model name : Intel(R) Xeon(TM) MP CPU 2.80GHz
physical id : 2

processor : 3
model name : Intel(R) Xeon(TM) MP CPU 2.80GHz
physical id : 3