리눅스 디스크 모니터링 - iostat i/o 모니터링

Featured image

placeholder

iostat 모니터링

iostat는 디스크 입출력 대한 통계를 보고하고 처리량, 사용률, 대기열 길이, 드랜잭션 비율 및 서비스 시간에 대한 측정 결과를 알수 있는 프로그램이입니다.

평소 디스크에 베드 섹터라든지 이상이 없는데, 서버의 부하가 평소보다 높을 경우에 디스크 사용량을 알수 있습니다.

또한 간단한 명령어 한줄로 디스크 처리의 입출력 통계 및 처리량, 대기열 길이등을 실시간으로 모니터링 할수 있습니다.

iostat 설치

1 [root@web /]# yum -y install sysstat

iostat 출력 정보

CPU의 사용자원 출력 정보

디스크 장치의 활용량 출력 정보

IOSTAT 사용법

iostat 명령어 : istat [옵션] [출력시간] [횟수]

iostat는 출력될 결과는 대부분 시간(출력될 시간)가 횟수(총 출력된 시간)를 숫자로 지정하여 사용합니다.

CPU 정보를 출력

명령어 : iostat -c [출력시간] [횟수]

 1 [root@web /]# iostat -c 1 3
 2 Linux 2.6.32-642.13.1.el6.x86_64 (web.server)   2017년 03월 16일   _x86_64_  (1 CPU)
 3 
 4 avg-cpu:  %user   %nice %system %iowait  %steal   %idle
 5            0.04    0.00    0.14    0.10    0.00   99.72
 6 
 7 avg-cpu:  %user   %nice %system %iowait  %steal   %idle
 8            0.00    0.00    0.00    0.00    0.00  100.00
 9  
10 avg-cpu:  %user   %nice %system %iowait  %steal   %idle
11            0.00    0.00    0.98    0.00    0.00   99.02

디스크 장치의 입출력 정보 출력

명령어 : iostat -d [출력시간] [횟수]

 1 [root@web /]# iostat -d 1 3
 2 Linux 2.6.32-642.13.1.el6.x86_64 (web.server)   2017년 03월 17일   _x86_64_  (1 CPU)
 3 
 4 Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
 5 scd0              0.00         0.02         0.00        264          0
 6 sda               0.75        21.61         7.80     303458     109580
 7 
 8 Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
 9 scd0              0.00         0.00         0.00          0          0
10 sda               0.00         0.00         0.00          0          0
11  
12 Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
13 scd0              0.00         0.00         0.00          0          0
14 sda               0.00         0.00         0.00          0          0

지정된 디스크 장치의 정보 출력

명령어 : iostat -p /dev/장치명

 1 [root@web /]# iostat -p /dev/sda
 2 Linux 2.6.32-642.13.1.el6.x86_64 (web.server)   2017년 03월 17일   _x86_64_  (1 CPU)
 3  
 4 avg-cpu:  %user   %nice %system %iowait  %steal   %idle
 5            0.02    0.00    0.11    0.06    0.00   99.80
 6 
 7 Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
 8 sda               0.61        16.97         6.34     303458     113428
 9 sda1              0.03         0.26         0.00       4636         28
10 sda2              0.03         0.26         0.00       4698         24
11 sda3              0.03         0.28         0.01       5066         96
12 sda4              0.00         0.00         0.00          4          0
13 sda5              0.03         0.26         0.00       4698         24
14 sda6              0.32         9.60         5.59     171570     100024
15 sda7              0.02         0.16         0.00       2904          0
16 sda8              0.13         6.08         0.74     108642      13232

디스크 장치의 활용량 출력 정보

확장된 통계 정보를 출력

명령어 : iostat -x

1 [root@web /]# iostat -x
2 Linux 2.6.32-642.13.1.el6.x86_64 (web.server)   2017년 03월 17일   _x86_64_  (1 CPU)
3 
4 avg-cpu:  %user   %nice %system %iowait  %steal   %idle
5            0.02    0.00    0.11    0.06    0.00   99.80
6  
7 Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
8 scd0              0.00     0.00    0.00    0.00     0.01     0.00     8.00     0.00    1.36    1.36    0.00   1.36   0.00
9 sda               0.12     0.62    0.44    0.16    16.72     6.27    38.02     0.00    4.79    2.62   10.74   2.02   0.12

References

https://itstudyblog.tistory.com/393