LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 06-30-2011, 10:44 AM   #1
youngnastyman
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.

Help!
 
Old 06-30-2011, 11:01 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 1,773

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

Code:
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 11:41 AM. Reason: Add note.
 
1 members found this post helpful.
Old 06-30-2011, 11:42 AM   #3
youngnastyman
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.
  


Reply


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 02:31 AM
Need cpu count in linux gamalpha Linux - Newbie 2 10-26-2009 04:23 PM
Determining Number of Physical CPU sagarparadkar Solaris / OpenSolaris 4 01-12-2009 11:08 PM
Howto reduce CPU count bret Linux - General 1 09-26-2007 07:12 PM
%CPU , Memory Usage, Thread count srinivasar Programming 0 09-20-2003 04:56 AM


All times are GMT -5. The time now is 11:43 AM.

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