Date: Wed, 25 Nov 2020 03:30:43 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 251363] use unionfs as a disk-cache for NFS [feature] Message-ID: <bug-251363-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D251363 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: bugs@FreeBSD.org Reporter: raj@gusw.net I just asked a question on stackexchange and developed a solution which cou= ld be useful to others too. May I refer you to the detail (nicely written up a= nd laid out with source code edits to all but get this done here: https://unix.stackexchange.com/questions/621430/has-anybody-heard-of-a-tric= k-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=3D1,oneopenown,...,late,bg 0 0 /dev/gpt/cachefs /usr unionfs=20 rw,copypolicy=3Dalways,copymode=3Dtransparent,whiteout=3Dwhenneeded 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 ha= nd, 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? --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-251363-227>