Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 06-30-2011, 09:44 AM   #1
LQ Newbie
Registered: Jun 2011
Posts: 2

Rep: Reputation: Disabled
How do I get the physical CPU socket count in RHEL?

We are working on our subscription renewal and now since Red Hat has changed their subscription model we need to give them the number of physical CPU sockets on each system.

I have tried looking thru /proc/cpuinfo as well as tried to parse data out from dmidecode but both of those solutions count each individual core as a CPU.

Is there a clean and easy way to determine the number of sockets on each system? We also use RHN Satellite to manage our systems but I believe that is pulling the same data from dmidecode.

Old 06-30-2011, 10:01 AM   #2
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,800

Rep: Reputation: 749Reputation: 749Reputation: 749Reputation: 749Reputation: 749Reputation: 749Reputation: 749
/proc/cpuinfo is the way to go - here's part of the last entry on my server:

processor       : 15
vendor_id       : GenuineIntel
cpu family      : 6
model           : 46
model name      : Intel(R) Xeon(R) CPU           E7520  @ 1.87GHz
stepping        : 6
cpu MHz         : 1862.049
cache size      : 18432 KB
physical id     : 1
siblings        : 8
core id         : 10
cpu cores       : 4
Since these are quad-core processors and I have 16 processors defined, you would think I have 4 chips. But no. Each core is hyperthreaded and counts as 2, so the right thing to look at is "siblings". I have 16 processors / 8 siblings = 2 chips.

Note: so to count them up:
if siblings = S, then each processor = 1/S chips
else if cores = C, then each processor = 1/C chips
else each processor = 1 chip

Last edited by smallpond; 06-30-2011 at 10:41 AM. Reason: Add note.
1 members found this post helpful.
Old 06-30-2011, 10:42 AM   #3
LQ Newbie
Registered: Jun 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
ok so i figured it out! lol...

this is what i did

cat /proc/cpuinfo |grep "physical id" |sort -n |uniq |wc -l

This seems to be the best way for me so far.. unless anyone can think of something better
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU core count raakin Linux - Newbie 14 08-01-2014 01:31 AM
Need cpu count in linux gamalpha Linux - Newbie 2 10-26-2009 03:23 PM
Determining Number of Physical CPU sagarparadkar Solaris / OpenSolaris 4 01-12-2009 10:08 PM
Howto reduce CPU count bret Linux - General 1 09-26-2007 06:12 PM
%CPU , Memory Usage, Thread count srinivasar Programming 0 09-20-2003 03:56 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:38 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration