Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!usc!zaphod.mps.ohio-state.edu!magnus.ircc.ohio-state.edu!csn!arrayb!taylor From: taylor@intellistor.com (Dick Taylor) Newsgroups: comp.benchmarks Subject: Re: Measuring disk read times for Unix Message-ID: <1991Feb27.233049.2972@intellistor.com> Date: 27 Feb 91 23:30:49 GMT References: <714@opus.NMSU.Edu> Distribution: comp Organization: Intellistor, Longmont, CO Lines: 26 In article <714@opus.NMSU.Edu> pfeiffer@nmsu.edu (Joe Pfeiffer) writes: >... >In order to measure write times, I'm using the O_SYNC to flush my data >to disk on each write. So far so good. > >I'm having trouble trying to do the equivalent for reads. I appear to >be filling up the OS's disk buffers on the first pass through the >test, after which reads come from there. While an obvious solution of >making the test file so huge it won't all fit in there would help, it >wouldn't be a complete solution. > >Any thoughts? There are a number of ways to do it. The niftiest that I ever found was to use the mount() and unmount() system calls to unmount the filesystem between each iteration of the benchmark. One warning, though -- this stresses those two system calls a lot more heavily than anything else they're used for. In some versions of SunOS, in particular, there are interactions with the update daemon that can crash the system quite spectacularly (this appears to be fixed in SunOS 4.1 and in Solbourne's OS/SMP-4.0D). Other ways to do this basically involve flushing large amounts of data through the filesystem buffers and hoping that the unwanted data disappears. Time-consuming and nasty, if you ask me. -- Dick Taylor Intellistor, Inc.