From owner-freebsd-questions@FreeBSD.ORG Wed May 5 15:03:27 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B7232106567D for ; Wed, 5 May 2010 15:03:27 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 2F6D88FC2E for ; Wed, 5 May 2010 15:03:26 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-0.2, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_50 0.80) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: o45F3AsX021440 Received: from kobe.laptop (ppp-94-64-210-113.home.otenet.gr [94.64.210.113]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-9.1) with ESMTP id o45F3AsX021440 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 5 May 2010 18:03:16 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.4/8.14.4) with ESMTP id o45F3Agr004466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 5 May 2010 18:03:10 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.4/8.14.4/Submit) id o45F38vw004463; Wed, 5 May 2010 18:03:08 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Peter Steele References: <7B9397B189EB6E46A5EE7B4C8A4BB7CB3E0CB171@MBX03.exg5.exghost.com> Date: Wed, 05 May 2010 18:03:08 +0300 In-Reply-To: <7B9397B189EB6E46A5EE7B4C8A4BB7CB3E0CB171@MBX03.exg5.exghost.com> (Peter Steele's message of "Wed, 5 May 2010 07:34:55 -0500") Message-ID: <877hnigzmb.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "freebsd-questions@freebsd.org" Subject: Re: Suspect results from iostat--FBSD bug? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 May 2010 15:03:27 -0000 On Wed, 5 May 2010 07:34:55 -0500, Peter Steele 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@kobe:/home/keramida$ cat -n demo.c : 1 #include : 2 #include : 3 : 4 int : 5 main(void) : 6 { : 7 (void)printf("-1 => %lu\n", (unsigned long)-1); : 8 return 0; : 9 } : keramida@kobe:/home/keramida$ cc demo.c : keramida@kobe:/home/keramida$ ./a.out : -1 => 4294967295 : keramida@kobe:/home/keramida$ Which _precise_ version of FreeBSD are you using?