From owner-freebsd-questions@FreeBSD.ORG Fri Mar 25 03:30:31 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 F286716A4CE for ; Fri, 25 Mar 2005 03:30:30 +0000 (GMT) Received: from web50910.mail.yahoo.com (web50910.mail.yahoo.com [206.190.39.38]) by mx1.FreeBSD.org (Postfix) with SMTP id 8299D43D41 for ; Fri, 25 Mar 2005 03:30:30 +0000 (GMT) (envelope-from jonstew1983@yahoo.com) Received: (qmail 23220 invoked by uid 60001); 25 Mar 2005 03:30:30 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=T19b01tBNtKTTqLyciIx8XpS/9miWEQDXDsOxEja76rqGjxwQWV9FhIIkU/Nq1IUYM/wepYvLtbSNqJmUWifiQ7jDtETS3rNknG1VLuDCj+2pZAU88ETAweucL7UZxjJTSvc7fbYE8JW1VjLlR2r8Gk7+8rI9FPxKmZXHtva8JU= ; Message-ID: <20050325033029.23218.qmail@web50910.mail.yahoo.com> Received: from [204.117.152.100] by web50910.mail.yahoo.com via HTTP; Thu, 24 Mar 2005 19:30:29 PST Date: Thu, 24 Mar 2005 19:30:29 -0800 (PST) From: Jonathan Stewart To: Dan Nelson In-Reply-To: 6667 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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:30:31 -0000 --- Dan Nelson wrote: > 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. > In that case how would I track how much information a process has actually read from a drive? I occasionally run processes that will read as much as 40+ gig in a single run which takes quite a while and on windows :P I can see "bytes read" and "bytes written" per process which lets me track how much the program has read so far and thus get an idea of how close it is to done. Sorry for the run-on sentence there. Thanks, Jonathan __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/