How to Determine the Number of Physical CPUs in Windows and Linux

cpudiagnosticlinuxwindows

When running cat /proc/cpuinfo under Linux, a variety information is kicked-back. For example:

> cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 15
model name  : Intel(R) Xeon(R) CPU            5130  @ 2.00GHz
stepping    : 6
cpu MHz     : 1995.069
cache size  : 4096 KB
physical id : 0
siblings    : 2
core id     : 0
cpu cores   : 2
fpu     : yes
fpu_exception   : yes
cpuid level : 10
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx tm2 cx16 xtpr lahf_lm
bogomips    : 3991.76
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 15
model name  : Intel(R) Xeon(R) CPU            5130  @ 2.00GHz
stepping    : 6
cpu MHz     : 1995.069
cache size  : 4096 KB
physical id : 3
siblings    : 2
core id     : 0
cpu cores   : 2
fpu     : yes
fpu_exception   : yes
cpuid level : 10
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx tm2 cx16 xtpr lahf_lm
bogomips    : 3989.46
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

First, what does all of that actually mean? I see I have a processor 0 and processor 1. Does that mean Linux is reporting both cores of the CPU, or, since it is a VM, the two that I happen to have right now (even if they're on physically different CPUs)?

Second, how can I get a similar information dump form the command line in Windows?

Third, is there a way using either platform to determine the number of physical CPUs versus total CPU cores?

Best Answer

To answer your first question: http://www.richweb.com/cpu_info describes all the cpuinfo output in good detail with some interesting discussion following the article.

In your case it's reporting that your VM is configured to show itself to the OS as a two-physical-core VM. The bare metal under the VM might be 1 core or 100 cores but as far as the OS in the VM is concerned you've got a machine with two physical processors that it can play with. It knows nothing of how threads that it assigns to those processors are actually being run on the physical hardware underneath the VM.

To get somewhat similar information from a Windows CMD shell you can try the systeminfo command from a CMD shell. It displays a whole lot more than the /proc/cpuinfo stuff in Linux, but also not quite as much detail about the actual processors themselves.

I don't know the answer to your third question, sorry.

Related Question