티스토리 뷰
스왑 메모리란?
메모리가 부족할 경우를 대비해 하드디스크의 일부를 메모리처럼 사용하는 기법
2017/01/23 - [Computer/Linux] - (CentOS) 스왑메모리 설정
사용량 확인 (top)
STEP 1) top
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | top - 12:54:48 up 40 days, 1:23, 1 user, load average: 0.00, 0.01, 0.05 Tasks: 64 total, 3 running, 61 sleeping, 0 stopped, 0 zombie %Cpu(s): 0.3 us, 0.0 sy, 0.0 ni, 99.0 id, 0.7 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem: 1017980 total, 953712 used, 64268 free, 8312 buffers KiB Swap: 1999996 total, 1270600 used, 729396 free. 47540 cached Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 20 0 191040 1832 1068 S 0.0 0.2 1:42.57 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.39 kthreadd 3 root 20 0 0 0 0 S 0.0 0.0 0:50.51 ksoftirqd/0 5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H 7 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh 9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/0 10 root 20 0 0 0 0 S 0.0 0.0 3:27.23 rcu_sched 11 root 20 0 0 0 0 R 0.0 0.0 7:11.04 rcuos/0 12 root rt 0 0 0 0 S 0.0 0.0 0:24.53 watchdog/0 | cs |
일반적으로 top 명령어는 기본 시스템 자원의 사용량을 보여주지만 스왑메모리까지 보여주진 않는다.
STEP 2) f 입력
top 상태에서 f 키를 입력하면 아래와 같은 화면으로 들어간다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | Fields Management for window 1:Def, whose current sort field is %CPU Navigate with Up/Dn, Right selects for move then <Enter> or Left commits, 'd' or <Space> toggles display, 's' sets sort. Use 'q' or <Esc> to end! * PID = Process Id * USER = Effective User Name * PR = Priority * NI = Nice Value * VIRT = Virtual Image (KiB) * RES = Resident Size (KiB) * SHR = Shared Memory (KiB) * S = Process Status * %CPU = CPU Usage * %MEM = Memory Usage (RES) * TIME+ = CPU Time, hundredths * COMMAND = Command Name/Line PPID = Parent Process pid UID = Effective User Id RUID = Real User Id RUSER = Real User Name SUID = Saved User Id SUSER = Saved User Name GID = Group Id GROUP = Group Name PGRP = Process Group Id TTY = Controlling Tty TPGID = Tty Process Grp Id SID = Session Id nTH = Number of Threads P = Last Used Cpu (SMP) TIME = CPU Time SWAP = Swapped Size (KiB) CODE = Code Size (KiB) DATA = Data+Stack (KiB) nMaj = Major Page Faults nMin = Minor Page Faults nDRT = Dirty Pages Count WCHAN = Sleeping in Function Flags = Task Flags <sched.h> CGROUPS = Control Groups SUPGIDS = Supp Groups IDs SUPGRPS = Supp Groups Names TGID = Thread Group Id ENVIRON = Environment vars vMj = Major Faults delta vMn = Minor Faults delta USED = Res+Swap Size (KiB) nsIPC = IPC namespace Inode nsMNT = MNT namespace Inode nsNET = NET namespace Inode nsPID = PID namespace Inode nsUSER = USER namespace Inode nsUTS = UTS namespace Inode | cs |
잘 보면.. 32번째 줄에 SWAP 이라고 표시되어있다
이 설정을 켜주자.
(키보드의 화살표로 이동하고, d나 스페이스바로 켜고 끌수있다.)
STEP 3) 확인하기
q를 눌러 메뉴를 빠져나온 후 보면 아래와 같이 확인이 가능하다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | top - 12:59:05 up 40 days, 1:27, 1 user, load average: 0.00, 0.01, 0.05 Tasks: 64 total, 3 running, 61 sleeping, 0 stopped, 0 zombie %Cpu(s): 0.4 us, 0.2 sy, 0.0 ni, 99.1 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem: 1017980 total, 946056 used, 71924 free, 5384 buffers KiB Swap: 1999996 total, 1270436 used, 729560 free. 43436 cached Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND SWAP 12669 root 20 0 123652 1528 1052 R 0.4 0.2 0:00.26 top 0 9425 root 20 0 3166204 688376 3152 S 0.2 67.6 14:49.19 java 640716 9715 root 20 0 0 0 0 R 0.2 0.0 0:20.67 kworker/0:1 0 12551 root 20 0 141404 5612 4248 S 0.2 0.6 0:01.56 sshd 0 1 root 20 0 191040 1832 1068 S 0.0 0.2 1:42.59 systemd 864 2 root 20 0 0 0 0 S 0.0 0.0 0:00.39 kthreadd 0 3 root 20 0 0 0 0 S 0.0 0.0 0:50.51 ksoftirqd/0 0 5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H 0 7 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 0 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh 0 9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/0 0 10 root 20 0 0 0 0 S 0.0 0.0 3:27.24 rcu_sched 0 11 root 20 0 0 0 0 R 0.0 0.0 7:11.06 rcuos/0 0 12 root rt 0 0 0 0 S 0.0 0.0 0:24.53 watchdog/0 0 13 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 khelper 0 14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs 0 15 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns | cs |
↑ 스크롤을 맨 오른쪽으로 땡겨서 보자
'Computer > Server:Linux&Window' 카테고리의 다른 글
리눅스의 iptables (0) | 2017.05.17 |
---|---|
(Linux) rootkit hunter (0) | 2017.04.12 |
(CentOS) centOS 7 php 5.6 설치 (0) | 2017.02.02 |
(CentOS) 특정 유저에 ROOT 권한 부여하기 (0) | 2017.02.02 |
(CentOS) ssh User, Group 생성, 확인 (0) | 2017.02.01 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- xcode
- Phaser
- 깃헙
- 앵커브리핑
- Swift
- 서버
- 스위프트
- Kotlin
- 리눅스
- C
- 안드로이드
- linux
- Asterisk
- IOS
- git hub
- BBC 가쉽
- C언어
- node.js
- 뉴스룸
- 배열
- mysql
- 점유율
- CentOS
- Android
- 노드
- nodejs
- php
- 손석희
- Node
- GIT
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함