• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Find Number of CPU Sockets on a CentOS/RHEL System

by admin

In our company we have some 3rd-party products installed on CentOS/RHEL systems. The Application team needed to do some accounting on how each product was licensed using number of CPU sockets in the each system. Sadly they did not have any type of CMDB in place to help (Configuration Management Database – something very handy to have when it comes to looking at your server inventory). Here is a short note to get the number of CPU sockets on a CentOS/RHEL system.

Determine number of CPU sockets

1. To accurately determine the number of CPU sockets on a system without physically opening and manually inspecting it, one must rely on the system’s DMI table (populated by the BIOS). Install the dmidecode package (if necessary) and then, as root, run the following:

# dmidecode -t4 | grep Socket.Designation: | wc -l

2. If all the CPU sockets on the system are filled (i.e., each socket has a processor in it), performing any of the following as a normal user will be sufficient:

– Consult the /proc/cpuinfo file, e.g.:

$ grep physical.id /proc/cpuinfo | sort -u | wc -l

– RHEL6 and above: Use the lscpu command, e.g.:

$ lscpu | grep -i "socket(s)"

– RHEL6 and above: Use the lstopo command, provided by the hwloc package, e.g.:

$ lstopo --whole-system --only Socket

Filed Under: Linux

Some more articles you might also be interested in …

  1. gifsicle: GIF manipulator
  2. mktemp Command Examples in Linux
  3. rpm: command not found
  4. CentOS / RHEL 6 : How to force a NTP sync with the NTP server(s)
  5. iostat Command Examples in Linux
  6. fallocate: command not found
  7. CentOS / RHEL : How to add swap file
  8. How to Clone Linux disk partition over network using dd
  9. javac Command Examples
  10. just Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright