System information

To provide caching services, FS-Cache needs a cache back-end. A cache back-end is a storage
driver configured to provide caching services (i.e. cachefi l es). In this case, FS-Cache requires a
mounted block-based file system that supports bmap and extended attributes (e.g. ext3) as its cache
back-end.
FS-Cache cannot arbitrarily cache any file system, whether through the network or otherwise: the
shared file system's driver must be altered to allow interaction with FS-Cache, data storage/retrieval,
and metadata set up and validation. FS-Cache needs indexing keys and coherency data from the
cached file system to support persistence: indexing keys to match file system objects to cache
objects, and coherency data to determine whether the cache objects are still valid.
Note: cachefi l esd
In Red Hat Enterprise Linux 6.2 including all previous versions, cachefi lesd is not installed
by default and will need to be installed manually.
10.1. Performance Guarant ee
FS-Cache does not guarantee increased performance, however it ensures consistent performance by
avoiding network congestion. Using a cache back-end incurs a performance penalty: for example,
cached NFS shares add disk accesses to cross-network lookups. While FS-Cache tries to be as
asynchronous as possible, there are synchronous paths (e.g. reads) where this isn't possible.
For example, using FS-Cache to cache an NFS share between two computers over an otherwise
unladen GigE network will not demonstrate any performance improvements on file access. Rather,
NFS requests would be satisfied faster from server memory rather than from local disk.
The use of FS-Cache, therefore, is a compromise between various factors. If FS-Cache is being used
to cache NFS traffic, for instance, it may slow the client down a little, but massively reduce the network
and server loading by satisfying read requests locally without consuming network bandwidth.
10.2. Set t ing Up a Cache
Currently, Red Hat Enterprise Linux 6 only provides the cachefi l es caching back-end. The
cachefi l esd daemon initiates and manages cachefi l es. The /etc/cachefi l esd . co nf file
controls how cachefi les provides caching services. To configure a cache back-end of this type,
the cachefi l esd package must be installed.
The first setting to configure in a cache back-end is which directory to use as a cache. To configure
this, use the following parameter:
$ d i r /path/to/cache
Typically, the cache back-end directory is set in /etc/cachefi l esd . co nf as
/var/cache/fscache, as in:
$ dir /var/cache/fscache
FS-Cache will store the cache in the file system that hosts /path/to/cache. On a laptop, it is
advisable to use the root file system (/) as the host file system, but for a desktop machine it would be
more prudent to mount a disk partition specifically for the cache.
Chapt er 1 0 . FS- Cache
75