Does Network File System has a smart cache

Latest response

Hi all,

It has been told that the NFSv4.2 is already being implemented in the Red Hat Enterprise Linux 7. I have a question concerning the NFS cache. Does NFS have a smart cache which can smart prefetch and/or smart commit?

Responses

Correct:

NFS uses the regular filesystem cache.

The method to configure readahead on an NFS mount is described at:

I am not sure what you mean by smart commit, but NFS uses asynchronous I/O and the regular Linux dirty page flush mechanism. The page flush behaviour can be tuned with the regular sysctl -a | grep dirty tunables.

The nfs(5) man page describes the attribute cache mount options and the sync mount option which can alter caching/flushing behaviour on the NFS Client. The exports(5) man page describes the sync and async export options which can alter this behaviour on the NFS Server.

By smart commit, I mean that if multiple clients write the same NFS share will the file be corrupted or there is a mechanism protect the share?

NFS has file locking, so that only one NFS Client can write to a file or an area of a file at the same time.

As long as locking is working, the file should not get corrupted.

Locking is done with a separate RPC daemon in NFSv3, and in-protocol with StateID in NFSv4.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.