Re: fread delays?

From: Stuart (bigdakine_at_aol.com)
Date: 08/11/04


Date: 11 Aug 2004 09:43:09 -0700

Barry Margolin <barmar@alum.mit.edu> wrote in message news:<barmar-B89510.21410407082004@comcast.dca.giganews.com>...
> In article <ae00b9e3.0408071350.2b862075@posting.google.com>,
> bigdakine@aol.com (Stuart) wrote:
>
> > Basically, the software is a realtively simple code that uses fseek,
> > and then performs an fread on about 200 files. Now when I execute this
> > code after a long stretch (>1day) since the last time, it will use
> > about 18secs of wall clock time. Each subsequent time, perhaps a tenth
> > of a second, unless there is another long stretch when it is not used.
> ...
> > Does this have to do with disk cacheing? Still, 18secs seems like a
> > long time to do freads on like 220 files, uncached or not. Is there a
> > tunning issue lurking somewhere? The disks involved are
> > MAXTOR-ATLAS10K4 drives.
>
> Yes, it's most likely due to caching. The first time you run it, none
> of the file data is in memory, so it has to read it in from disk. And
> since you're doing lots of seeking, it's hard for it to optimize it with
> read-ahead. So you're jumping all over the disk, and the latency of
> moving the read arm really adds up.

So what exactly is it caching? The information in the inodes? Because
subsequent runs are requesting vastly different "seeks". Subsequent
runs are requesting information that is not physically close together
with the information requested previously on the disk.

We do not have a continual operational need for this software.
However, when we do need it, we need it to execute it as fast as
possible. I guess one thing I could do is run it in the cron a few
times a day, to keep the cache in memory. Thats an ugly kludge, but
other than that, I don't see what else I can do.

THanks,

Stuart



Relevant Pages

  • Re: fread delays?
    ... > bigdakine@aol.com (Stuart) wrote: ... > of the file data is in memory, so it has to read it in from disk. ... subsequent runs are requesting vastly different "seeks". ...
    (comp.unix.solaris)
  • Re: Computer Whizkids .Dead PC.What to check first .??
    ... > scrambled somehow - same error message etc. ... I had to use some recovery ... > software to recover the disk, but no further problems with the mobo once ... >> Stuart wrote: ...
    (uk.local.glasgow)
  • Re: fread delays?
    ... > bigdakine@aol.com (Stuart) wrote: ... > of the file data is in memory, so it has to read it in from disk. ... cache fresh. ...
    (comp.unix.solaris)
  • Re: disk error from /var/adm/messages
    ... You have a bad block on this disk. ... whether or not you can repair the bad block. ... Dr. Stuart A. Weinstein ...
    (comp.unix.solaris)
  • Re: XAUG - The Christian Acorn Users Group
    ... Stuart wrote: ... Mr John FO Evans wrote: ... I have sent an announcement to c.s.a.announce requesting "a show of hands" ...
    (comp.sys.acorn.misc)