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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. How to use sudo to allow a non-root user run a particular command
  2. rpm: error while loading shared libraries: invalid ELF header
  3. CentOS / RHEL 6 : how to start the services interactively during boot (to disable/abort some services)
  4. How to enable SFTP Logging without chroot in CentOS/RHEL
  5. How to create partitions and file systems on DM-Multipath devices
  6. How to Extend the Last Existing Filesystem Partition with Parted
  7. How to find which rpm package provides a specific file or library in RHEL / CentOS
  8. Beginners Guide to Global File System 2 (GFS2)
  9. Configuring Remote Logging using rsyslog in CentOS/RHEL
  10. Understanding the /etc/fstab file in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary