프린트 하기

OS환경 : Oracle Linux 6.4 (64bit)

 

방법 : Oracle Linux 6 서버 cpu, memory 사용량 확인

리눅스 6에서 cpu나 메모리 사용량을 확인하는법을 설명함

 

 

cpu 사용량 확인(top 명령)

상단 Cpus(s)부분에서 사용량 확인 가능

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
# top
top - 20:11:10 up 5 min,  1 user,  load average: 0.190.410.22
Tasks: 113 total,   2 running, 111 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.5%sy,  0.0%ni, 98.2%id,  1.4%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   4037808k total,   348364k used,  3689444k free,    27680k buffers
Swap: 10239996k total,        0k used, 10239996k free,   123184k cached
 
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 4593 root      20   0 99.8m 7360 6328 R  0.5  0.2   0:00.11 sshd
    1 root      20   0 19416 2332 2020 S  0.0  0.1   0:02.02 init
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd
    3 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
    5 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 kworker/0:0H
    6 root      20   0     0    0    0 S  0.0  0.0   0:00.07 kworker/u128:0
    7 root      20   0     0    0    0 S  0.0  0.0   0:00.17 rcu_sched
    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.08 rcuos/0
   10 root      20   0     0    0    0 S  0.0  0.0   0:00.00 rcuob/0
   11 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
   12 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0
   13 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 khelper
   14 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kdevtmpfs
   15 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 netns
   16 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 perf
   17 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khungtaskd
   18 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 writeback
   19 root      25   5     0    0    0 S  0.0  0.0   0:00.00 ksmd
   20 root      39  19     0    0    0 S  0.0  0.0   0:00.03 khugepaged
   21 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 crypto
   22 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 kintegrityd
   23 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 bioset
   24 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 kblockd
   25 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 ata_sff
   26 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 md
   27 root      20   0     0    0    0 S  0.0  0.0   0:02.26 kworker/0:1
   29 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kswapd0
   30 root      20   0     0    0    0 S  0.0  0.0   0:00.00 fsnotify_mark
   42 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 kthrotld
   43 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 acpi_thermal_pm
   44 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kworker/u128:1
   45 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 kpsmoused
   46 root      20   0     0    0    0 S  0.0  0.0   0:01.61 kworker/0:2
   47 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 bcache
 

 

 

메모리 사용량 확인(free 명령)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
메모리 사용량 kb 단위로 확인
# free -k
             total       used       free     shared    buffers     cached
Mem:       4037808     347756    3690052       1660      27612     122896
-/+ buffers/cache:     197248    3840560
Swap:     10239996          0   10239996
 
메모리 사용량 mb 단위로 확인
# free -m
             total       used       free     shared    buffers     cached
Mem:          3943        339       3603          1         26        120
-/+ buffers/cache:        192       3750
Swap:         9999          0       9999
 
메모리 사용량 gb 단위로 확인
# free -g
             total       used       free     shared    buffers     cached
Mem:             3          0          3          0          0          0
-/+ buffers/cache:          0          3
Swap:            9          0          9

 

 

참조 :