The parameters that we have added to configure our caching scheme are:
|mount syntax||Internal name||Description|
||Enables reading from the cache (but not updating)|
||Location of disk cache|
||Min free space for that cache partition|
||Maximum cached data for this partition (kb)|
The first option, dc_enable, controls whether files read from the remote partition are to be cached. By selectively enabling caching for remote partitions, a system administrator can choose not to cache certain partitions which may be written to frequently. Such partitions are not likely to benefit from a local cache. The second option is related: dc_read, permits a partition to have files already cached locally be used, but not update the cache when remote files changes, or a new remote file is accessed. This option is especially useful during debugging.
The next two options,
disk_cache_min_free, specify the directory where the cache files
should live and how much space must minimally remain free on the local
disk partition where that directory resides. Different remote
partitions may be cached in different directories, but do not need to
be. The local cache location is just an ordinary directory that is
dedicated to holding cache files and information. For example, if a
host has a large /tmp partition, a system administrator could
create /tmp/.nfs-cache and use that for the NFS cache--no
special partitioning or reformatting is required.
disk_cache_max_size option permits specifying the
maximum amount of local disk space to use for caching a given remote
partition. Using this parameter, a system administrator can allocate
more local disk space for heavily caching an important remote partition,
or limit the amount of local disk space a rarely-needed partition is
allowed to consume.
The flexibility of our caching scheme permits the caching NFS client to be introduced into a production system with minimal hassle and effort.