Best way to measure disk bandwidth usage

Dan Nelson dnelson at
Wed Nov 7 10:11:46 PST 2007

In the last episode (Nov 07), Andrea Venturoli said:
> Doug Clements ha scritto:
>> gstat, iostat, and systat -vm are the tools I use for this.
> Thanks for the fast answer.
> A couple more questions:
> gstat gives percentage values: what are these and how are they
> computed? In the man page I can find no answer.

Both gstat's and "iostat -x"'s %busy column is just an indicator of how
often there was a pending request to the disks.  If it's less than
100%, then you know the disk is idle some of the time.  If it's 100%,
however, that just means there's always at least one request on the
queue.  It doesn't mean the drive has hit any performance limits,
though, since you can usually queue 32 or more commands to a single
drive, and sequential requests complete a lot faster than random ones. 
A better indicator of overload is the command latency (ms/r in gstat or
svc_t in iostat).
> iostat is also expecially interesting, since it can run
> non-interactively and I could poll it through cacti... However this
> monitors only raw da devices. Is there a way to get gmirrors
> monitored?

I don't think any of the geom system hooks into devstat (which is where
iostat gets its info).  It'd sure be nice :)  It would also allow you to
query some stats via net-snmp's diskIO mib.

> Finally this gives overall MB/s, which is very interesting, but I'd
> also need to refer this to an end-of-scale value, in order to
> understand if the disks are working to their fullest (and thus are
> the bottleneck). Is this correct? Where could I desume such a value?
> (I remember there was an utility... though I don't remember its
> name).

That really depends on your drives and the interfaces you use to
connect them.  For sata or sas drives, you could probably run each
drive at its rated maximum speed (which will be different for each
model; diskinfo -t can help here).  For SCSI, FC, or drives hung off a
raid controller, your bottleneck may be the speed of the shared
interface or your pci bus, depending on how many drives you have

	Dan Nelson
	dnelson at

More information about the freebsd-questions mailing list