From owner-freebsd-bugs@freebsd.org Wed Nov 25 03:30:45 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BDB3473A28 for ; Wed, 25 Nov 2020 03:30:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4Cgmcj0M60z4TBY for ; Wed, 25 Nov 2020 03:30:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 077AE473926; Wed, 25 Nov 2020 03:30:45 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0067A4737F2 for ; Wed, 25 Nov 2020 03:30:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cgmch4RdJz4THG for ; Wed, 25 Nov 2020 03:30:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE46427ED for ; Wed, 25 Nov 2020 03:30:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AP3UhS8067138 for ; Wed, 25 Nov 2020 03:30:43 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 0AP3UhDv067137 for bugs@FreeBSD.org; Wed, 25 Nov 2020 03:30:43 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 251363] use unionfs as a disk-cache for NFS [feature] Date: Wed, 25 Nov 2020 03:30:43 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: raj@gusw.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 03:30:45 -0000 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.=