Difference between revisions of "Iostat"

From Linuxintro
imported>ThorstenStaerk
m
Line 3: Line 3:
 
= Install it =
 
= Install it =
 
To install iostat, install the package sysstat. For example with SUSE Linux you [[open a console]] and enter:
 
To install iostat, install the package sysstat. For example with SUSE Linux you [[open a console]] and enter:
<source>
 
 
  yast -i sysstat
 
  yast -i sysstat
</source>
 
  
 
= Run it =
 
= Run it =
 
Just call IOstat plus the time interval in seconds:
 
Just call IOstat plus the time interval in seconds:
<source>
 
 
# iostat 10
 
# iostat 10
 
Linux 2.6.34.7-0.5-desktop (tweedleburg)        12/11/10        _x86_64_        (8 CPU)
 
Linux 2.6.34.7-0.5-desktop (tweedleburg)        12/11/10        _x86_64_        (8 CPU)
Line 20: Line 17:
 
sda              1.35        5.56        28.55    1337701    6870465
 
sda              1.35        5.56        28.55    1337701    6870465
 
md126            4.26        11.32        28.38    2723674    6830024
 
md126            4.26        11.32        28.38    2723674    6830024
</source>
+
 
 
You will get a new block every 10 seconds in this case.
 
You will get a new block every 10 seconds in this case.
  
 
Zoom in to one device, 1 second interval:
 
Zoom in to one device, 1 second interval:
<source>
 
 
# iostat -xmt 1 -d /dev/sda
 
# iostat -xmt 1 -d /dev/sda
 
Linux 2.6.34.7-0.7-desktop (tweedleburg)        03/03/11        _x86_64_        (8 CPU)
 
Linux 2.6.34.7-0.7-desktop (tweedleburg)        03/03/11        _x86_64_        (8 CPU)
Line 35: Line 31:
 
Device:        rrqm/s  wrqm/s    r/s    w/s    rMB/s    wMB/s avgrq-sz avgqu-sz  await  svctm  %util
 
Device:        rrqm/s  wrqm/s    r/s    w/s    rMB/s    wMB/s avgrq-sz avgqu-sz  await  svctm  %util
 
sda              0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  0.00  0.00
 
sda              0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  0.00  0.00
</source>
 
  
 
== avgrq-sz ==
 
== avgrq-sz ==
 
avgrq-sz is the average request size ("blocksize") in 512 byte sectors. You can influence it with [[dd]]'s iflag/oflag parameter, for example:
 
avgrq-sz is the average request size ("blocksize") in 512 byte sectors. You can influence it with [[dd]]'s iflag/oflag parameter, for example:
<source>
 
 
  dd if=/dev/dm-11 of=/dev/null iflag=direct bs=64K
 
  dd if=/dev/dm-11 of=/dev/null iflag=direct bs=64K
</source>
+
 
 
Note there is a max block size under /sys/block/''device''/queue/max_sector_kb
 
Note there is a max block size under /sys/block/''device''/queue/max_sector_kb
  

Revision as of 20:02, 25 March 2021

iostat is a program that shows how many I/O operations happen in a specified timeframe.

Install it

To install iostat, install the package sysstat. For example with SUSE Linux you open a console and enter:

yast -i sysstat

Run it

Just call IOstat plus the time interval in seconds:

  1. iostat 10

Linux 2.6.34.7-0.5-desktop (tweedleburg) 12/11/10 _x86_64_ (8 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle

          0.67    0.00    0.17    0.07    0.00   99.09

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn sdb 1.35 5.76 28.55 1387011 6870465 sda 1.35 5.56 28.55 1337701 6870465 md126 4.26 11.32 28.38 2723674 6830024

You will get a new block every 10 seconds in this case.

Zoom in to one device, 1 second interval:

  1. iostat -xmt 1 -d /dev/sda

Linux 2.6.34.7-0.7-desktop (tweedleburg) 03/03/11 _x86_64_ (8 CPU)

03/03/11 08:46:33 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util sda 0.03 1.63 0.06 0.72 0.00 0.01 26.56 0.08 108.28 4.64 0.36

03/03/11 08:46:34 Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

avgrq-sz

avgrq-sz is the average request size ("blocksize") in 512 byte sectors. You can influence it with dd's iflag/oflag parameter, for example:

dd if=/dev/dm-11 of=/dev/null iflag=direct bs=64K

Note there is a max block size under /sys/block/device/queue/max_sector_kb

See also