How to get physical number of CPU sockets on Linux server
บนเครื่อง Linux Server หากต้องการตรวจสอบว่าเครื่อง server ที่ใช้งานอยู่มีจำนวน CPU กี่ socket เราสามารถทำได้โดยไม่จำเป็นต้องไปเปิดเครื่อง server ดู โดยคำสั่งที่ใช้คือ dmidecode
การติดตั้ง dmidecode บน Centos
[shell][root@Ezylinux ~]# yum install dmidecode[/shell]
คำสั่งในการตรวจสอบจำนวน CPU ว่ามีกี่ socket สามารถรันคำสั่งได้ดังนี้
[shell][root@Ezylinux ~]# dmidecode -t4 | grep Socket.Designation: | wc -l[/shell]
นอกจากนี้ยังมีวิธีการอื่นที่สามารถตรวจสอบได้อีกคือตรวจสอบที่ไฟล์ /proc/cpuinfo โดยรันคำสั่งดังนี้
[shell][root@Ezylinux ~]# grep physical.id /proc/cpuinfo | sort -u | wc -l[/shell]