• 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. “docker image” Command Examples
  2. losetup: command not found
  3. macchanger: command not found
  4. sm Command Examples in Linux
  5. cheat: Create and view interactive cheat sheets on the command-line
  6. loginctl: command not found
  7. rspamc Command Examples in Linux
  8. bpftool Command Examples in Linux
  9. rpm: command not found
  10. “git-grep” Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples
  • “glab mr” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright