Can I set file caching to zero?

From: CSCF Staff \(rehorka\) <"CSCF>
Date: Tue, 27 Jul 1999 09:28:41 -0400 (EDT)

I have a researcher who is trying to prevent caching from causing a bias
in the timing of different functions that read from disk. He needs to
time how long two different methods take to read the same data from the
same files. Unfortunately, once he's run the first function, so much of
the data is cached that the second function appears dramatically
faster. This behavior persists even if he swaps the order of the
functions. He has tried several methods with varying degrees of
success, but what he is looking for is 0% cache hit rate. Since the
difference in times of the two functions may be relatively small,
any caching will obscure this difference. Sequentially reading a
large file seems to be terrible at doing this. Randomly reading a large
file is better but not good. He has also used the sync()
(although not fsync() ) function which works suprisingly well at
times but not always. It seems like the I/O subsystem is too
sophisticated. The only ways I know of to do this are to reboot the
system or re-mount the file system, both of which are impractical.


Gary Rehorka Computer Science Computing Facility,
rehorka_at_cs.umass.edu LGRC Room A313,
Tel: (413)545-4822 University of Massachusetts
Fax: (413)545-1249 Amherst, MA 01003
Received on Tue Jul 27 1999 - 13:30:44 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:39 NZDT