https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251363

            Bug ID: 251363
           Summary: use unionfs as a disk-cache for NFS [feature]
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: b...@freebsd.org
          Reporter: r...@gusw.net

I just asked a question on stackexchange and developed a solution which could
be useful to others too. May I refer you to the detail (nicely written up and
laid out with source code edits to all but get this done here:
https://unix.stackexchange.com/questions/621430/has-anybody-heard-of-a-trick-to-make-a-local-hard-drive-based-cache-of-nfs-p

Summary:

Problem: NFS can be slow, when starting binaries (e.g. /usr/bin) over NFS, such
as in a network booted system. RAM buffer cache might not be sufficient to
avoid slowness.

Idea: it seems we should be able to have a local disk cache which would save
the file(s) locally as they are pulled from NFS. The unionfs kernel module
(mount_unionfs) has a copy-on-write feature, and with only fairly few simple
changes in the source code, we could turn this into a copy-always
(copy-on-read) disk cache for NFS. Here is the /etc/fstab file that I am
thinking:

# Custom /etc/fstab for FreeBSD VM images
/dev/gpt/rootfs  /        ufs      rw      1       1
/dev/gpt/varfs   /var     ufs      rw      1       1
fdesc            /dev/fd  fdescfs  rw      0       0
proc             /proc    procfs   rw      0       0
/usr             /.usr    nullfs   rw      0       0
fs-xxxxxxxx.efs.rrrr.amazonaws.com:/ /usr nfs
rw,nfsv4,minorversion=1,oneopenown,...,late,bg 0 0
/dev/gpt/cachefs /usr     unionfs 
rw,copypolicy=always,copymode=transparent,whiteout=whenneeded 0 0

in my source code walk-through I am showing how this can be implemented. I
don't have a source tree installed currently and only an AWS instance at hand,
so it will take me some time to actually do this. But I wanted to throw it out
here to see if others find it cool and useful and if they want to
review/criticize my code proposal already or run with it?

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to