Date: Thu, 24 Mar 2005 19:30:29 -0800 (PST) From: Jonathan Stewart <jonstew1983@yahoo.com> To: Dan Nelson <dnelson@allantgroup.com> Cc: freebsd-questions@freebsd.org Subject: Re: Discrepancy between ps -i -o inblk and figuring numbers by hand Message-ID: <20050325033029.23218.qmail@web50910.mail.yahoo.com> In-Reply-To: 6667
next in thread | raw e-mail | index | archive | help
--- Dan Nelson <dnelson@allantgroup.com> 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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050325033029.23218.qmail>
