Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Aug 2017 15:35:01 +0100
From:      Frank Leonhardt <frank2@fjl.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Re: Does NFS client cache?
Message-ID:  <59A81E95.1060300@fjl.co.uk>
In-Reply-To: <206BE5FE-7A80-4CCA-8107-F3BBD3FC00FA@rafal.net>
References:  <206BE5FE-7A80-4CCA-8107-F3BBD3FC00FA@rafal.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 30/08/2017 21:13, Rafal Lukawiecki wrote:
> Apologies for my FreeBSD newbieness…coming from CentOS/Amazon Linux and on a fast knowledge ramp-up at the moment.
>
> I would like to know if the NFS client in FreeBSD performs any/some/none caching of the files clients fetch. I am used to installing fscache (cachefilesd, see http://people.redhat.com/~dhowells/fscache/FS-Cache.pdf) on Linuxes, with an fstab mount flag “fsc” to perform persistent caching to the local *disk*. This gives me significant performance improvements on the Linuxes I have used. Is this not done at all, or done in some other way on FreeBSD? I could not find any relevant ports.
>
> The use case is cloud-based servers caching centrally managed NFS files that contain rarely changing config and dev data, however all speed-critical data is locally rsynced.
>
> Many thanks and my regards from Ireland,
> Rafal
> --
>

Sometimes :-) NFS caching is a problem, especially when you consider the 
effects of fsync() and being POSIX compliant in this respect. If you 
cache a file, even R/O, then an fsync() operation on one host must 
invalidate the cache on ALL other hosts before returning. Strictly 
speaking. In practice there are a lot of kernel tuneables to ignore this 
(some undocumented IME). You can also comment out the code that deals 
with the fsync() requests.

Best strategy depends on exactly what you're trying to do. I'd probably 
copy files to local storage as a cron job as an early option.

(Thanks for the info on AWS)

Regards, Frank.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?59A81E95.1060300>