알고보면 쓸데있는 신비한 잡학IT노트

ioping 을 이용한 IOPS 측정

남차장 2021. 5. 18. 09:50

네트워크에 PING 이 있다면, 디스크에는 IO Latency 를 확인해 볼 수 있는 IOPING 이 있습니다. 


http://code.google.com/p/ioping/

다운 받아보면 아주 간단하게 구성되어 있습니다.

# ls
ioping.1  ioping.c  ioping.spec  Makefile

Makefile 이 이미 존재하므로 바로 make 를 해주면 컴파일이 됩니다.

# make
cc -std=c99 -g -Wall -Wextra -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVERSION=\"0.6\" -c -o ioping.o ioping.c
cc -o ioping ioping.o -std=c99 -g -Wall -Wextra -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -lm

실행해 보면 아래와 같은 도움말을 볼 수 있습니다.

# ./ioping
 Usage: ioping [-LCDRq] [-c count] [-w deadline] [-p period] [-i interval]
               [-s size] [-S wsize] [-o offset] device|file|directory
        ioping -h | -v

      -c <count>      stop after <count> requests
      -w <deadline>   stop after <deadline>
      -p <period>     print raw statistics for every <period> requests
      -i <interval>   interval between requests (1s)
      -s <size>       request size (4k)
      -S <wsize>      working set size (1m)
      -o <offset>     in file offset
      -L              use sequential operations (includes -s 256k)
      -C              use cached I/O
      -D              use direct I/O
      -R              seek rate test (same as -q -i 0 -w 3 -S 64m)
      -q              suppress human-readable output
      -h              display this message and exit
      -v              display version and exit

 

따로 메뉴얼이 없어도 대략 어떤 의미인지가 추정이 됩니다. 그만큼 사용법이 간단하다는 의미가 되겠죠.

 

# ./ioping /dev/sda6 

4096 bytes from /dev/sda6 (device 309.1 Gb): request=1 time=14.5 ms

4096 bytes from /dev/sda6 (device 309.1 Gb): request=2 time=5.3 ms

4096 bytes from /dev/sda6 (device 309.1 Gb): request=3 time=9.3 ms

4096 bytes from /dev/sda6 (device 309.1 Gb): request=4 time=7.5 ms

4096 bytes from /dev/sda6 (device 309.1 Gb): request=5 time=6.3 ms

4096 bytes from /dev/sda6 (device 309.1 Gb): request=6 time=9.0 ms

^C

--- /dev/sda6 (device 309.1 Gb) ioping statistics ---

6 requests completed in 5645.3 ms, 116 iops, 0.5 mb/s

min/avg/max/mdev = 5.3/8.6/14.5/3.0 ms

 

실행해 보면 ping 에서 보던 것과 유사하게 출력이 됩니다. 

IO latency 를 실시간으로 확인할 필요가 있으신 분들은 참고하시기 바랍니다.