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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. Configure VSFTPD Chroot Environment in CentOS and RHEL
  2. CentOS / RHEL : How to configure an DHCP server
  3. Basic NFS Security – NFS, no_root_squash and SUID
  4. How to Clone Linux disk partition over network using dd
  5. Understanding TCP Wrappers (/etc/hosts.allow & /etc/hosts.deny) in Linux
  6. Nohup Command Examples – Runs a Command that Keeps Running after You Log Out
  7. Audit Rule Configuration not Reflected – How to troubleshoot
  8. How to Run SCP Without Password Prompt Interruption in Linux
  9. CentOS / RHEL : How to mount filesystems using UUID
  10. “mount.nfs: access denied by server while mounting” – how to resolve

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright