Linux/Ubuntu2011. 9. 27. 16:34
iostat 라는 멋진 녀석이 있다는데
ubuntu 10.04 LTS desktop edition에서는 기본 포함되어 있지 않고 systat 패키지를 설치해야만 한다.

$ idstat -d 3
이라고만 치면 3초에 한번 disk에 대해서 리포팅을 한다.

$ iostat -d -x 5 3

[링크 : http://www.cyberciti.biz/tips/linux-disk-performance-monitoring-howto.html

Blk_read/s
Indicate the amount of data read from the device expressed in a number of blocks per second. Blocks are equivalent to sectors with 2.4 kernels and newer and therefore have a size of 512 bytes. With older kernels, a block is of indeterminate size.

Blk_wrtn/s
Indicate the amount of data written to the device expressed in a number of blocks per second.

iostat -d 2
Display a continuous device report at two second intervals.

[링크 : http://linux.die.net/man/1/iostat

Posted by 구차니
Linux2010. 1. 11. 11:42
/proc/diskstats 파일은 linux kernel 2.6 부터 지원하는 것으로
hdd의 파일 입출력 속도를 볼 수 있다.

음.. FC6에서는 해보니, 1초 간격으로 갱신되는것 같은데
$ cat /proc/diskstats
   1    0 ram0 0 0 0 0 0 0 0 0 0 0 0
   1    1 ram1 0 0 0 0 0 0 0 0 0 0 0
   1    2 ram2 0 0 0 0 0 0 0 0 0 0 0
   1    3 ram3 0 0 0 0 0 0 0 0 0 0 0
   1    4 ram4 0 0 0 0 0 0 0 0 0 0 0
   1    5 ram5 0 0 0 0 0 0 0 0 0 0 0
   1    6 ram6 0 0 0 0 0 0 0 0 0 0 0
   1    7 ram7 0 0 0 0 0 0 0 0 0 0 0
   1    8 ram8 0 0 0 0 0 0 0 0 0 0 0
   1    9 ram9 0 0 0 0 0 0 0 0 0 0 0
   1   10 ram10 0 0 0 0 0 0 0 0 0 0 0
   1   11 ram11 0 0 0 0 0 0 0 0 0 0 0
   1   12 ram12 0 0 0 0 0 0 0 0 0 0 0
   1   13 ram13 0 0 0 0 0 0 0 0 0 0 0
   1   14 ram14 0 0 0 0 0 0 0 0 0 0 0
   1   15 ram15 0 0 0 0 0 0 0 0 0 0 0
   3    0 hda 108013 40509 5794964 3417656 108015 779595 7103102 61420792 0 2737052 64843120
   3    1 hda1 1076 2158 19 38
   3    2 hda2 147415 5792382 887883 7103064
 253    0 dm-0 147169 0 5791122 5857704 887853 0 7102824 1796618756 0 2736044 1802476620
 253    1 dm-1 70 0 560 1432 30 0 240 38624 0 6188 40056
   2    0 fd0 0 0 0 0 0 0 0 0 0 0 0
   9    0 md0 0 0 0 0 0 0 0 0 0 0 0

이런식으로 숫자만 잔뜩 나온다.

/proc/diskstats, giving some information (including device numbers) for each of the logical disk devices
[링크 : http://en.wikipedia.org/wiki/Procfs]

sysstat 패키지의 iostat 유틸리티
[링크 : http://elenoa.tistory.com/52]

3.2 /proc/diskstat => disk utilization, throughput (only 2.6 kernels)
[링크 : http://duo830210.tistory.com/45]

Field  1 -- # of reads completed
    This is the total number of reads completed successfully.

Field  2 -- # of reads merged, field 6 -- # of writes merged
    Reads and writes which are adjacent to each other may be merged for
    efficiency.  Thus two 4K reads may become one 8K read before it is
    ultimately handed to the disk, and so it will be counted (and queued)
    as only one I/O.  This field lets you know how often this was done.

Field  3 -- # of sectors read
    This is the total number of sectors read successfully.

Field  4 -- # of milliseconds spent reading
    This is the total number of milliseconds spent by all reads (as
    measured from __make_request() to end_that_request_last()).

Field  5 -- # of writes completed
    This is the total number of writes completed successfully.

Field  7 -- # of sectors written
    This is the total number of sectors written successfully.

Field  8 -- # of milliseconds spent writing
    This is the total number of milliseconds spent by all writes (as
    measured from __make_request() to end_that_request_last()).

Field  9 -- # of I/Os currently in progress
    The only field that should go to zero. Incremented as requests are
    given to appropriate struct request_queue and decremented as they finish.

Field 10 -- # of milliseconds spent doing I/Os
    This field is increases so long as field 9 is nonzero.

Field 11 -- weighted # of milliseconds spent doing I/Os
    This field is incremented at each I/O start, I/O completion, I/O
    merge, or read of these stats by the number of I/Os in progress
    (field 9) times the number of milliseconds spent doing I/O since the
    last update of this field.  This can provide an easy measure of both
    I/O completion time and the backlog that may be accumulating.

[링크 : http://www.mjmwired.net/kernel/Documentation/iostats.txt]


Posted by 구차니