From owner-freebsd-questions@freebsd.org Thu Aug 31 14:35:00 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBF9AE1FDCA for ; Thu, 31 Aug 2017 14:35:00 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from bs1.fjl.org.uk (bs1.fjl.org.uk [84.45.41.196]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bs1.fjl.org.uk", Issuer "bs1.fjl.org.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8011F7E913 for ; Thu, 31 Aug 2017 14:35:00 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from [10.4.242.25] ([46.233.78.25]) (authenticated bits=0) by bs1.fjl.org.uk (8.14.4/8.14.4) with ESMTP id v7VEYvlJ008461 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO) for ; Thu, 31 Aug 2017 15:34:58 +0100 (BST) (envelope-from frank2@fjl.co.uk) Message-ID: <59A81E95.1060300@fjl.co.uk> Date: Thu, 31 Aug 2017 15:35:01 +0100 From: Frank Leonhardt Reply-To: Frank Leonhardt Organization: Frank Leonhardt User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: Does NFS client cache? References: <206BE5FE-7A80-4CCA-8107-F3BBD3FC00FA@rafal.net> In-Reply-To: <206BE5FE-7A80-4CCA-8107-F3BBD3FC00FA@rafal.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Aug 2017 14:35:01 -0000 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.