i am trying to find out hpw many virtual and physical processors does any linux machine has:
output of /proc/cpuinfo is as below :
[root@VM172016001139 etc]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 26
model name : Intel(R) Xeon(R) CPU X5670 @ 2.93GHz
stepping : 4
cpu MHz : 2933.437
cache size : 12288 KB
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc up nonstop_tsc arat pni ssse3 cx16 sse4_1 sse4_2 popcnt lahf_lm
bogomips : 5866.87
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: [8]
using this info how can i figure out how many physical or virtual processor does any linux machine has...is der any better way to find out or any small script
Actually, from a vm guest, this can be quite difficult. I mean, in most cases for most all hypervisor, any and all CPUs are virtual. The actually allocation given to a VM is often times only known to the hypervisor host itself and not to the guest.
On a physical box, it all depends.
If you have contemporary CPUs, and you have a relatively contemporary Linux, /proc/cpuinfo will likely show what you want. However, if you have older CPUs and/or older Linux, the information could be very inaccurate.
In your case, and this is a guess, looks like you've been assigned one virtual CPU.... what that means though, isn't well defined.