CentOS CPU core 확인 - CentOS CPU core hwag-in

don't stop believing

Linux/CentOS

CentOS CPU Core 수 확인

Tongchun 2017. 10. 16. 15:41

간혹 부하 테스트를 할때 부하를 발생하는 Agent 서버의 CPU Core를 확인해야 할 때까 있다.

CentOS에서 CPU Core 확인하는 명령어를 알아봅시다.

dmidecode를 사용할 수 있으며 아래에서 설치명령을 확인할 수 있다.

[CentOS dmidecode 설치]

CPU 코어 전체 개수 확인

$ grep -c processor /proc/cpuinfo
4

물리 CPU 개수 확인

$ grep ^processor /proc/cpuinfo | wc -l
4
$ sudo dmidecode -t processor | grep 'Socket Designation'
	Socket Designation: CPU 1
	Socket Designation: CPU 2
	Socket Designation: CPU 3
	Socket Designation: CPU 4

CPU당 물리 코어 수 확인

$ grep 'cpu cores' /proc/cpuinfo | tail -l
cpu cores	: 2
cpu cores	: 2
cpu cores	: 2
cpu cores	: 2

리눅스(CentOS)에서 CPU 개수 및 Core 수를 확인 하는 방법을 소개하는 글입니다.

현상

  • 회사에서 사용하는 분석 서버의 스펙을 요청받아 상세 CPU 정보 확인이 필요해 짐

조치

  • 분석 서버(Linux)에서 아래 명령어들을 입력하여 상세 정보 확인

1. 물리적인 CPU 개수

grep "physical id" /proc/cpuinfo | sort -u | wc -l
CentOS CPU core 확인 - CentOS CPU core hwag-in

2. CPU 1개 당 물리적인 코어(Core) 수

grep "cpu cores" /proc/cpuinfo | tail -1
CentOS CPU core 확인 - CentOS CPU core hwag-in

3. CPU 전체 코어 개수

사용중인 분석 서버는 하이퍼 스레딩을 지원하고 있어 전체 코어수가 36개가 아닌 72개로 나타남

grep -c processor /proc/cpuinfo
CentOS CPU core 확인 - CentOS CPU core hwag-in

참고사항

  • 하이퍼 쓰레딩(hyper-threading)에 따른 CPU 전체 개수 확인에 혼란이 있을 수 있음
  • 결과 전달시 해당 서버의 하이퍼 쓰레딩 지원 유무도 함께 전달하는 것이 필요

관련 링크

System Info.

Windows 10
Python 3.8.1
PyCharm 2020.3.3 (Community Edition)
R version 4.0.3 (2020-10-10)
RStudio Version 1.4.1103
JRE: 11.0.2+159 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

반응형

일반적인 경우, 하이퍼스레딩에 의해 OS(윈도우, 리눅스 등)에서 코어 수가 실제 코어 수의 2배로 인식된다.

예를 들어 싱글코어는 코어 2개로, 듀얼코어는 4개로 인식된다.

1. CPU 코어 전체 개수 

# grep -c processor /proc/cpuinfo

# ll -d /sys/devices/system/cpu/cpu? | wc -l

2. 물리 CPU 수

# grep ^processor /proc/cpuinfo | wc -l

3. CPU 당 물리 코어 수

# grep 'cpu cores' /proc/cpuinfo | tail -1

참고사이트 : https://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_CPU_%EA%B0%9C%EC%88%98_%ED%99%95%EC%9D%B8

반응형

저작자표시

'Server' 카테고리의 다른 글

[CentOS] SSH 포트 변경  (0) 2020.06.01
웹, WAS METHOD 차단 관련 (PGET, POST, OPTIONS...)  (0) 2020.05.28
[CentOS] yum 설치 시 could not resolve host: mirrorlist centos org  (0) 2020.04.14
[CentOS] euckr 파일명 utf8로 인코딩 변경  (0) 2020.03.23
[CentOS7] 언어 (locale) 설정  (0) 2020.03.21

CPU 상세정보
# cat /proc/cpuinfo

CentOS CPU core 확인 - CentOS CPU core hwag-in
CPU 상세 정보


코어 수
# nproc

CentOS CPU core 확인 - CentOS CPU core hwag-in
CPU 코어 숫자


dmidecode 상세 스펙
# dmidecode -t processor

CentOS CPU core 확인 - CentOS CPU core hwag-in
dmidecode -t processor


메모리 상세 스펙
# cat /proc/meminfo

CentOS CPU core 확인 - CentOS CPU core hwag-in
메모리 상세 스펙


총 용량 
# free -h

CentOS CPU core 확인 - CentOS CPU core hwag-in
free -h

메모리 슬록 확인

# dmidecode -t 17 | egrep 'Momory|Size'

CentOS CPU core 확인 - CentOS CPU core hwag-in


dmidecode 상세 스펙
# dmidecode -t memory

CentOS CPU core 확인 - CentOS CPU core hwag-in
dmidecode -t memory more

dmidecod -t [옵션]

더보기

       Type   Information 
       ──────────────────────────────────────────── 
          0   BIOS 
          1   System 
          2   Baseboard 
          3   Chassis 
          4   Processor 
          5   Memory Controller 

          6   Memory Module 
          7   Cache 
          8   Port Connector 
          9   System Slots 
         10   On Board Devices 
         11   OEM Strings 
         12   System Configuration Options 
         13   BIOS Language 
         14   Group Associations 
         15   System Event Log 
         16   Physical Memory Array 
         17   Memory Device 
         18   32-bit Memory Error 
         19   Memory Array Mapped Address 
         20   Memory Device Mapped Address 
         21   Built-in Pointing Device 
         22   Portable Battery 
         23   System Reset 
         24   Hardware Security 
         25   System Power Controls 
         26   Voltage Probe 
         27   Cooling Device 
         28   Temperature Probe 
         29   Electrical Current Probe 
         30   Out-of-band Remote Access 
         31   Boot Integrity Services 
         32   System Boot 
         33   64-bit Memory Error 
         34   Management Device 
         35   Management Device Component 
         36   Management Device Threshold Data 
         37   Memory Channel 
         38   IPMI Device 
         39   Power Supply 
         40   Additional Information 
         41   Onboard Devices Extended Information 
         10   On Board Devices 
         11   OEM Strings 
         12   System Configuration Options 
         13   BIOS Language 
         14   Group Associations 
         15   System Event Log 
         16   Physical Memory Array 
         17   Memory Device 
         18   32-bit Memory Error 
         19   Memory Array Mapped Address 
         20   Memory Device Mapped Address 
         21   Built-in Pointing Device 
         22   Portable Battery 
         23   System Reset 
         24   Hardware Security 
         25   System Power Controls 
         26   Voltage Probe 
         27   Cooling Device 
         28   Temperature Probe 
         29   Electrical Current Probe 
         30   Out-of-band Remote Access 
         31   Boot Integrity Services 
         32   System Boot 
         33   64-bit Memory Error 
         34   Management Device 
         35   Management Device Component 
         36   Management Device Threshold Data 
         37   Memory Channel 
         38   IPMI Device 
         39   Power Supply 
         40   Additional Information 
         41   Onboard Devices Extended Information 
         42   Management Controller Host Interface