Article Title: View cpu usage in linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
At present, the cpu of machines is getting more and more complex. A single cpu is often a few kernels, such as 4, 6, and 8.
When my company purchased an 8-cpu AMD server with dual-core, we saw a spectacular cpu with 16 CPUs.
This scenario can be seen on a common 2U server.
Http://planet.admon.org/howto/about-cpu-the-logical-and-physical-cores/
There are some commands here to help identify these type of information quickly on a running Linux:
Total amount of processors including the logical ones:
# Cat/proc/cpuinfo | grep "processor" | wc-l
Total amount of CPU package:
# Cat/proc/cpuinfo | grep "physical id" | sort | uniq | wc-l
How many cores for each CPU. (Here we shocould call CPU as physical package as we mentioned above ):
# Cat/proc/cpuinfo | grep "cpu cores" | wc-l
For each physical CPU, the amount of Logical CPU (the logical CPU can be physical cores, soft cores like threaded, or both ).
# Cat/proc/cpuinfo | grep "siblings"