From owner-freebsd-questions@FreeBSD.ORG Fri Mar 25 03:23:28 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0CA416A4CE for ; Fri, 25 Mar 2005 03:23:28 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A67743D48 for ; Fri, 25 Mar 2005 03:23:28 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j2P3NROD019362; Thu, 24 Mar 2005 21:23:27 -0600 (CST) (envelope-from dan) Date: Thu, 24 Mar 2005 21:23:27 -0600 From: Dan Nelson To: Jonathan Stewart Message-ID: <20050325032327.GE10908@dan.emsphone.com> References: <20050325025804.73930.qmail@web50906.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050325025804.73930.qmail@web50906.mail.yahoo.com> X-OS: FreeBSD 5.4-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.8i cc: freebsd-questions@freebsd.org Subject: Re: Discrepancy between ps -i -o inblk and figuring numbers by hand X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2005 03:23:28 -0000 In the last episode (Mar 24), Jonathan Stewart said: > When I run the command ps -u -o inblock on a process reading a > 262144000 byte file the highest block count I see is ~2010 but my > filesystem block size is 16384 and 262144000/16384 is 16000 so it > seems to be off by about a factor of 8. I even tried looking through > the source code for the ps command but my C is not good enough for me > to figure it out. Can someone explain or help me figure out what is > going on please. That ps column actually looks at the rusage value ru_inblk, which doesn't count the number blocks read, but the number of times the kernel did physical I/O on behalf of the process (how often the kernel blocked doing a read). The clustering code will fetch up to sysctl(vfs.read_max) blocks at a time into disk cache, so reading sequential files will increment ru_inblock (blocks_in_file/read_max) times. Raising vfs.read_max to 32 will greatly increase sequential read performance on fast RAID arrays. -- Dan Nelson dnelson@allantgroup.com