Wednesday, June 30, 2010

Display the number of processors on Linux

On a hyperthreaded system it can be confusing to determine exactly how many CPU's and Cores a machine has in use. Using the /proc/cpuinfo command will provide the information, but you want to isolate the processor id and core id information for an accurate count.

I am on Red Hat Enterprise 5

-- Type uname -r to display the kernel release
#
# uname -r
2.6.18-164.el5

-- cpuinfo provides the information.
# cat /proc/cpuinfo

-- Isolate the number of processors.
# grep "physical id" /proc/cpuinfo | sort -u | wc -l
2

-- Isolate the number of cores
# grep "core id" /proc/cpuinfo | sort -u | wc -l
4

No comments:

Post a Comment

Oracle runInstaller fails on Linux, Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set.

How to get Oracle's runInstaller to run on Linux or Unix environment using from Windows using Cygwin as an xterm emulator. Download an...