From owner-freebsd-questions@FreeBSD.ORG Sat Nov 17 00:03:18 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F373D16A418; Sat, 17 Nov 2007 00:03:17 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.bluestop.org (muon.bluestop.org [IPv6:2001:41c8:1:548a::2]) by mx1.freebsd.org (Postfix) with ESMTP id 920C513C43E; Sat, 17 Nov 2007 00:03:17 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.draftnet (cran1.demon.co.uk [80.177.26.208]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.bluestop.org (Postfix) with ESMTP id 562B930114; Sat, 17 Nov 2007 00:03:16 +0000 (GMT) Message-ID: <473E2FAA.2050607@cran.org.uk> Date: Sat, 17 Nov 2007 00:02:50 +0000 From: Bruce Cran User-Agent: Thunderbird 2.0.0.9 (X11/20071116) MIME-Version: 1.0 To: Ivan Voras References: <473C7C0A.4060708@shopzeus.com> <20071115182220.E60452@wojtek.tensor.gdynia.pl> <473CAF70.1090006@cran.org.uk> <473DC14D.1060601@shopzeus.com> <9bbcef730711160829s186d0784g8546c2656f913c0f@mail.gmail.com> In-Reply-To: <9bbcef730711160829s186d0784g8546c2656f913c0f@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Laszlo Nagy , freebsd-questions@freebsd.org Subject: Re: How to set maximum disk cache size? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2007 00:03:18 -0000 Ivan Voras wrote: > On 16/11/2007, Laszlo Nagy wrote: >> Ivan Voras wrote: > >>> http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/vm-fileio.html >>> >> I read this too but I don't understand. Too difficult for me. >> >> So what is the answer? Do I need to set a sysctl or will FreeBSD use all >> available free memory for caching file data from disk? > > You don't need to change anything, it's the default state. So as long as the memory isn't shown as "Free" in top, any memory that isn't being used by the kernel or by applications is being used for cache/buffer? One reason why I had thought that FreeBSD didn't use all the memory for caching disk accesses was because I saw a different behaviour when decompressing large archives between Linux and FreeBSD: in Linux there's a massive burst of activity as the archive gets put straight into memory; then, once memory starts getting full it pauses for what seems a very long time as it flushes all the data to disk. FreeBSD doesn't seem to do that; it seems a lot smoother in that it writes to the disk a lot more regularly - is this likely to be because Linux has a higher limit on the number of dirty pages it can have in memory before it writes them out to disk? -- Bruce