시스템 구성정보 확인

EnoSoup·2021년 7월 26일
0

Linux

목록 보기
9/15
post-thumbnail

리눅스 시스템 구성정보 확인 방법

1. CPU 정보 확인
1.1 bios 키워드 결과
-------------------------------------
$ sudo dmidecode -t bios
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
	Vendor: Amazon EC2
	Version: 1.0
	Release Date: 10/16/2017
	Address: 0xF0000
	Runtime Size: 64 kB
	ROM Size: 64 kB
	Characteristics:
		PCI is supported
		EDD is supported
		ACPI is supported
		System is a virtual machine
	BIOS Revision: 1.0

# bios 키워드 결과는 보통 특정 BIOS 버전에 문제가 있을때 참조하여 내가 사용하는 버전이
# 해당하는지 확인할 때 주로 사용한다.
# 해당 BIOS는 Amazon에서 만든 서버이며, BIOS 버전은 2017/10/16일에 만든 1.0 버전이다.

1.2 system 키워드 결과
-------------------------------------
$ sudo dmidecode -t system
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: Amazon EC2
	Product Name: m5a.2xlarge
	Version: Not Specified
	Serial Number: ec260919-a4b4-deab-333d-b3270051a7e0
	UUID: EC260919-A4B4-DEAB-333D-B3270051A7E0
	Wake-up Type: Power Switch
	SKU Number: Not Specified
	Family: Not Specified

# 코드를 보면 장비는 Amazon에서 만든 m5a.2xlarge 모델이다.
# 모델명을 통해 해당장비가 어느정도의 성능을 낼 수 있는지 확인 할 수 있다.

1.3 processor 키워드 결과
-------------------------------------
$ sudo dmidecode -t processor
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.

Handle 0x0004, DMI type 4, 42 bytes
Processor Information
	Socket Designation: CPU 0
	Type: Central Processor
	Family: <OUT OF SPEC>
	Manufacturer: Advanced Micro Devices, Inc.
	ID: 12 0F 80 00 FF FB 8B 17
	Version: AMD EPYC 7571
	Voltage: 1.0 V
	External Clock: 100 MHz
	Max Speed: 3000 MHz
	Current Speed: 2200 MHz
	Status: Populated, Enabled
	Upgrade: <OUT OF SPEC>
	L1 Cache Handle: Not Provided
	L2 Cache Handle: Not Provided
	L3 Cache Handle: Not Provided
	Serial Number: Not Specified
	Asset Tag: Not Specified
	Part Number: Not Specified
	Core Count: 4
	Core Enabled: 4
	Thread Count: 8
	Characteristics:
		64-bit capable
		Multi-Core
		Hardware Thread
		Execute Protection

# 내용을 살펴보면 총 0개의 소켓이 있고, 각각의 소켓은 AMD EPYC 7571임을 알 수 있다.
# 소켓 : 물리전인 CPU의 개수를 의미
# 코어 : 물리적인 CPU 안에 몇개의 컴퓨팅 코어가 있는지를 뜻한다.
# 코드를 보면 코어는 4개가 전부 사용되고 있고 하이퍼 스레딩 기능을 통해서 각각의 코어가 멀티로
# 동작해서 총 8개의 코어를 사용할 수 있는 상황이다. 소켓당 8개의 코어를 사용할 수 있기 때문에
# 시스템 전체적으로는 8코어를 사용할 수 있다.(해당서버는 0개의 소켓이 있기 때문)

2. 메모리 정보 확인하기
2.1 memory 키워드 결과
--------------------------------
$ sudo dmidecode -t memory

# ec2 서버는 조회가 되지 않는다.

# memory 키워드는 크게 Physical Memory Array와 Memory Device의 두 영역으로 나눌 수 있다.
# Physical Memory Array : 하나의 CPU 소켓에 함께 할당된 물리 메모리의 그룹을 의미
# Memory Device : 실제로 시스템에 꽃혀 있는 메모리를 의마

2.2 디스크 정보 확인하기
--------------------------------
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs         16G     0   16G   0% /dev
tmpfs            16G     0   16G   0% /dev/shm
tmpfs            16G  440K   16G   1% /run
tmpfs            16G     0   16G   0% /sys/fs/cgroup
/dev/nvme0n1p1  300G   16G  285G   6% /
tmpfs           3.1G     0  3.1G   0% /run/user/1000

# 위 서버는 1개의 파티션이 있다. tmpfs는 램디스크를 사용하기 위한 파티션이다.
# 방식은 nvme 디스크 방시글 사용하고 있으며, IDE 방식의 디스크는 hda로, SCSI 방식의 디스크와
# 최근에 나오는 SATA, SAS와 같은 일반적인 하드 디스크는 sda로 표시된다.
# vda는 가상서버에서 흔히 볼 수 있는 디크스 타입니다. XEN, KVM과 같이 하이퍼바이저(Hypervisor)
# 위에서 동작 중인 서버들에서 주로 볼 수 있다.

2.2.1 디스크 파티션 정보 확인하기
# smartctl 설치
$ sudo yum -y install smartmontools

# 파티션 정보 확인
$ smartctl -a /dev/nvme0n1p1
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.14.171-136.231.amzn2.x86_64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       Amazon Elastic Block Store
Serial Number:                      vol03a8d0f0dd30d888d
Firmware Version:                   1.0
PCI Vendor/Subsystem ID:            0x1d0f
IEEE OUI Identifier:                0xa002dc
Controller ID:                      0
Number of Namespaces:               1
Namespace 1 Size/Capacity:          322,122,547,200 [322 GB]
Namespace 1 Utilization:            0
Namespace 1 Formatted LBA Size:     512
Local Time is:                      Tue Mar 16 08:02:53 2021 UTC
Firmware Updates (0x03):            1 Slot, Slot 1 R/O
Maximum Data Transfer Size:         64 Pages

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     0.01W       -        -    0  0  0  0  1000000 1000000
 1 +     0.00W       -        -    0  0  0  0        0       0

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         0

=== START OF SMART DATA SECTION ===
Read NVMe SMART/Health Information failed: NVMe Status 0x4002

# 코드를 확인해 보면 /dev/nvme0n1p1는 Amazon EBS 볼륨이며, 사이즈 등을 확인할 수 있다.
# RAID 컨트롤러를 사용한다면 "smartctl -a /dev/nvme0n1p1 -d cciss,0" 명령어를 사용하여
# 정보를 확인할 수 있다.
# 현재 사용중인 RAID 컨트롤러의 드라이버는 lsmod 명령을 통해서 확인할 수 있다.

3. 네트워크 정보 확인하기
3.1 lspci 명령
--------------------------------
$ lspci | grep -i ether
00:05.0 Ethernet controller: Amazon.com, Inc. Elastic Network Adapter (ENA)

# 위 서버는 Amazon에서 만든 ENA 모델을 사용하고 있는 네트워크 카드이다.
# 이 정보가 중요한 이유 : 간혹 특정 모델에서 버그나 이슈 등이 보고될 때 자신의 서버가 해당되는지
# 파악해야 하며, 커널 드라이버를 업데이트할 때에도 해당하는 펌웨어 드라이버를 찾기 위해서이다.

3.2 ethtool 명령
--------------------------------
$ ethtool -g eth0
Ring parameters for eth0:
Pre-set maximums:
RX:		16384
RX Mini:	0
RX Jumbo:	0
TX:		1024
Current hardware settings:
RX:		1024
RX Mini:	0
RX Jumbo:	0
TX:		1024

# Ring Buffer : 네트워크 카드의 버퍼 공간을 의미
# 케이블을 통해 들어온 패킷 정보는 Ring Buffer라는 버퍼 공간에 복사된다. 그 후 커널에 패킷의 도착을
# 알리고 패킷의 정보를 다시 커널로 복사한다. 그렇기 때문에 Ring Buffer의 크기가 작다면 네트워크 성능
# 저하를 일으킬 수 있다. 항상 maximums 값과 current 값이 같도록 세팅해야 한다.
# -G 옵션은 Ring Buffer 값을 설정할 때 사용된다.

3.2.1 ethtool -k eth0 명령
--------------------------------
$ ethtool -k eth0
Features for eth0:
rx-checksumming: on
tx-checksumming: on
	tx-checksum-ipv4: on
	tx-checksum-ip-generic: off [fixed]
	tx-checksum-ipv6: off [fixed]
	tx-checksum-fcoe-crc: off [fixed]
	tx-checksum-sctp: off [fixed]
scatter-gather: on
	tx-scatter-gather: on
	tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: off
	tx-tcp-segmentation: off [fixed]
	tx-tcp-ecn-segmentation: off [fixed]
	tx-tcp-mangleid-segmentation: off [fixed]
	tx-tcp6-segmentation: off [fixed]
udp-fragmentation-offload: off
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: off [fixed]
rx-vlan-offload: off [fixed]
tx-vlan-offload: off [fixed]
ntuple-filters: off [fixed]
receive-hashing: on
highdma: on
rx-vlan-filter: off [fixed]
vlan-challenged: off [fixed]
tx-lockless: off [fixed]
netns-local: off [fixed]
tx-gso-robust: off [fixed]
tx-fcoe-segmentation: off [fixed]
tx-gre-segmentation: off [fixed]
tx-gre-csum-segmentation: off [fixed]
tx-ipxip4-segmentation: off [fixed]
tx-ipxip6-segmentation: off [fixed]
tx-udp_tnl-segmentation: off [fixed]
tx-udp_tnl-csum-segmentation: off [fixed]
tx-gso-partial: off [fixed]
tx-sctp-segmentation: off [fixed]
tx-esp-segmentation: off [fixed]
fcoe-mtu: off [fixed]
tx-nocache-copy: off
loopback: off [fixed]
rx-fcs: off [fixed]
rx-all: off [fixed]
tx-vlan-stag-hw-insert: off [fixed]
rx-vlan-stag-hw-parse: off [fixed]
rx-vlan-stag-filter: off [fixed]
l2-fwd-offload: off [fixed]
hw-tc-offload: off [fixed]
esp-hw-offload: off [fixed]
esp-tx-csum-hw-offload: off [fixed]
rx-udp_tunnel-port-offload: off [fixed]

# -k 옵션으로 현재 사용중인 네트워크 카드의 다양한 성능 최적화 옵션을 확인할 수 있다.
# -K 옵션은 네트워크 카드의 성능 최적화 옵션을 설정할 때 사용된다.

3.2.2 ethtool -i eth0 명령
--------------------------------
driver: ena
version: 2.2.3g
firmware-version:
expansion-rom-version:
bus-info: 0000:00:05.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

# 사용 중인 네트워크 카드가 어떤 커널 드라이버를 사용하는지, 버전이 몇인지를 알 수 있다.
# 이는 특정 커널 드라이버의 버전에서 문제가 생겼을 경우 내가 사용하는 버전이 해당되는지 판단할 때 필요하다.
profile
Cloud Engineer@Plateer. 클라우드 상에서 엔지니어링을 재미있게 하는 엔지니어입니다.

0개의 댓글