How do I find out the number of CPU cores available under HP x86_64 Linux serer running on RHEL / Debian Linux 6.x?
You can use the lscpu or nproc command to display the number of processing units available to the current process, which may be less than the number of online processors (please note that not all server supports hotplug a CPU on a running Linux system).
The proc file system is a pseudo-file system which is used as an interface to kernel data structures. It is commonly mounted at /proc. The /proc/cpuinfo file is nothing but a collection of CPU and system architecture dependent items, for each supported architecture a different list. Two common entries are processor which gives CPU number and bogomips; a system constant that is calculated during kernel initialization. SMP machines have information for each CPU.
nproc Example
The nproc command shows the number of processing units available:
lscpu Command
lscpu gathers CPU architecture information form /proc/cpuinfo in human-read-able format:
/proc/cpuinfo
The /proc/cpuinfo and sysfs stores info about your CPU architecture ike number of CPUs, threads, cores, sockets, NUMA nodes, information about CPU caches, CPU family, model, bogoMIPS, yte order and much more:
Check out related media
Here is a quick demo of lscpu and /proc/cpuinfo commands:
沒有留言:
張貼留言