cachefilesd

Caching with CacheFS

NFS

FS cache is not used:

$ cat /proc/fs/nfsfs/volumes 
 
NV SERVER   PORT DEV          FSID                              FSC
v4 c0a84190  801 0:258        7e59ad2c8fec4a2b:93201b279cd3026b no 

Install FS cache:

sudo apt install cachefilesd -y

Enable it:

/etc/default/cachefilesd
# Defaults for cachefilesd initscript
# sourced by /etc/init.d/cachefilesd
 
# You must uncomment the run=yes line below for cachefilesd to start.
# Before doing so, please read /usr/share/doc/cachefilesd/howto.txt.gz as
# extended user attributes need to be enabled on the cache filesystem.
RUN=yes
 
# Additional options that are passed to the Daemon.
DAEMON_OPTS=""
$ cat /proc/fs/fscache/stats
 
FS-Cache statistics
Cookies: n=0 v=0 vcol=0 voom=0
Acquire: n=0 ok=0 oom=0
LRU    : n=0 exp=0 rmv=0 drp=0 at=0
Invals : n=0
Updates: n=0 rsz=0 rsn=0
Relinqs: n=0 rtr=0 drop=0
NoSpace: nwr=0 ncr=0 cull=0
IO     : rd=0 wr=0
RdHelp : RA=0 RP=0 WB=0 WBZ=0 rr=0 sr=0
RdHelp : ZR=0 sh=0 sk=0
RdHelp : DL=0 ds=0 df=0 di=0
RdHelp : RD=0 rs=0 rf=0
RdHelp : WR=0 ws=0 wf=0

Modify mount option for NFS and add -o fsc. Mount it again.