disk I/O statistics

I'm wondering how I can find information about the number of bytes transferred to and from the hard drive within a given period of time, as well as the mb/sec rates? I have checked into iostat, and that gives me part of that information, but not all.
 
I like gstat. I think I can use that for watching a device. But, I think I found part of the information I needed (if I'm reading it right).
Code:
iostat -dhI
gives:
             ad4 
  KB/t xfrs   MB 
 20.91 663400 13545.41
And, It looks like 13454.41 MB have been transferred in total. So, I should be able to save that number and on the next interval, determine a difference. Unless there's a better way?
 
blumstng said:
So, I should be able to save that number and on the next interval, determine a difference. Unless there's a better way?
That might be the most accurate way of doing it. Only thing to watch out for is wrap around... the counter is probably a 64 bit unsigned integer which would wrap back to zero after about 18 exabytes.
 
Only thing to watch out for is wrap around... the counter is probably a 64 bit unsigned integer which would wrap back to zero after about 18 exabytes.
Though I don't expect this to be a problem, I have added a check to make sure of wrap around. Better to account for as many possibilities as you can.

Thanks for all the input.
 
Enable bsnmpd in /etc/rc.conf.

Edit /etc/snmpd.config to set the IP to listen on and the community string (password) to use.

Install the net-mgmt/bsnmp-ucd port, and enable the ucd-snmp module in /etc/snmpd.config.

Then use SNMP to query the diskIO* MIBs: diskIONRead shows the number of bytes read, diskIONWritten shows the number of bytes written.

Use MRTG to poll it and generate pretty graphs. :)
 
@phoenix

I've been used that sources (diskIONRead and diskIONWritten) to gather info for RRDTool and this is what I've got:

12 disks, stripe of two raidz2, 6 disks each.
img_disk_IOR_gs_daily.png


4 disks, simple stripe.
img_disk_IOR_dl_daily.png


4 disks, raidz1
img_disk_IOR_movs_daily.png


All of them are very weird. It does not seem to be a Megabyte per second. I don't even have a clue what it can be. Maybe you can tell me - what does it mean?
 
Back
Top