Suspect results from iostat--FBSD bug?

Giorgos Keramidas keramida at ceid.upatras.gr
Wed May 5 15:03:27 UTC 2010


On Wed, 5 May 2010 07:34:55 -0500, Peter Steele <psteele at maxiscale.com> wrote:
> We use iostat to collect statistics of hard drive activity. We've been
> seeing some values for the transaction wait column that look
> suspicious. This is easy to reproduce by just running iostat
> repeatedly over a short period of time, as I show below. Notice the
> third from last column. From what I understand, when run in this
> fashion the values displayed are averaged over the system uptime. I'd
> expect then for the transaction wait value to not take these sudden
> dips. Is there an explanation for this?
>
> # for ((i=1; i <=100; i++)); do iostat -dxI ad8|tail +3; sleep 5; done
> ad8      10291.0 569044.0 151986.0 10164944.0 4294967295  47.7  93
> ad8      10304.0 570070.0 152012.0 10185395.0 4294967295  47.6  93
> ad8      10312.0 571047.0 152028.0 10204575.0   85  47.5  93

This looks like a bug in iostat.  4294967295 == 2 * 32 - -1

It seems that some call returns (unsigned long)-1, e.g. to indicate a
failing system/library call but iostat still prints the result:

: keramida at kobe:/home/keramida$ cat -n demo.c
:      1  #include <limits.h>
:      2  #include <stdio.h>
:      3
:      4  int
:      5  main(void)
:      6  {
:      7          (void)printf("-1 => %lu\n", (unsigned long)-1);
:      8          return 0;
:      9  }
: keramida at kobe:/home/keramida$ cc demo.c
: keramida at kobe:/home/keramida$ ./a.out
: -1 => 4294967295
: keramida at kobe:/home/keramida$

Which _precise_ version of FreeBSD are you using?



More information about the freebsd-questions mailing list