Remote FS caching [was: Re: Memory upgrade: not faster / nfs]

Olaf Kirch (
Sat, 26 Oct 1996 15:37:06 +0200 (MET DST)

Subject: Remote FS caching [was: Re: Memory upgrade: not faster / nfs]
X-Newsreader: TIN [UNIX 1.3 950515BETA PL0]

In article <> Dieter Kaeppel wrote:
: They are not buffered due to a lack of protocols which recognices
: changes in the remote filesystem. A protocol which transfers all
: changes in files may slow down the system dramatically, if

NFS does cache read data (see my other message). As far as cache
consistency is concerned, the usual approach on NFS mounts is to track
the file's modification time stamp on the server, and assume that any
cached data is valid as long as that time stamp doesn't change.

Since the client cannot obtain the file's mtime each time the user process
accesses the file, the inode's attributes are cached as well. There's
a minimum interval for which the cached attributes remain valid, which
is adjusted dynamically (low after a recent change has been detected,
higher if the file has remained unchanged for a certain period).

: - introduce an cache protocol, working this way:

Adding such a protocol would turn NFS into something which isn't
NFS anymore. Note that there are protocols that provide a better cache
consistency mechanism, probably the most widely known being AFS and DFS
(the latter being derived from AFS). Unfortunately, Transarc has not
released the protocol specification for AFS and DFS so a free implementation
is hard to do. Derek Atkins is maintaining an AFS client for Linux as
a binary-only loadable module (I don't envy him:-).

Then there's NQNFS, written for 4.4BSD (or was that 4.3?) by Rick Macklem.
It features a cache consistency protocol on top of NFS that is based
on `leases' which give the client the right to cache data for a specific
file and gurantees that the cached data remains valid until the server
revokes the lease. NQNFS is a nice protocol, but it has been implemented
only for BSD, and you cannot be an NFS client without being a server at
the same time (both AFAIK).

Finally, NFSv3 is a kind of dumbed-down NQNFS which provides what it
calls `weak cache consistency' by giving the client more information
about changes in a file's modification time stamp.

I recommend that those interested in the implementation of a remote
file system read U. Vahalia's ``UNIX Internals -- the new frontiers,''
``Design and Implementation of the 4.4BSD OS'' by McKusick et al. and
the NFSv2/NFSv3 specifications (available as RFCs 1049 and 1813).


Olaf Kirch        | XmToggleButton resource set; class Set; values set/unset |                                  Motif for Quiche Eaters