From owner-freebsd-questions@FreeBSD.ORG Thu Nov 15 20:43:53 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 E2C2816A418 for ; Thu, 15 Nov 2007 20:43:53 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.bluestop.org (unknown [IPv6:2001:41c8:1:548a::2]) by mx1.freebsd.org (Postfix) with ESMTP id 84F3013C46B for ; Thu, 15 Nov 2007 20:43:53 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.draftnet (unknown [IPv6:2a01:348:10f:1::5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.bluestop.org (Postfix) with ESMTP id 0CF1730114; Thu, 15 Nov 2007 20:43:52 +0000 (GMT) Message-ID: <473CAF70.1090006@cran.org.uk> Date: Thu, 15 Nov 2007 20:43:28 +0000 From: Bruce Cran User-Agent: Thunderbird 2.0.0.6 (X11/20071104) MIME-Version: 1.0 To: Wojciech Puchar References: <473C7C0A.4060708@shopzeus.com> <20071115182220.E60452@wojtek.tensor.gdynia.pl> In-Reply-To: <20071115182220.E60452@wojtek.tensor.gdynia.pl> Content-Type: text/plain; charset=ISO-8859-1; 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: Thu, 15 Nov 2007 20:43:54 -0000 Wojciech Puchar wrote: > Laszlo wrote: >> Hi All, >> >> Is there a way (sysctl?) to tell FreeBSD (6.2 RELEASE) how many memory >> can it use for caching file data from disk? >> >> It might be that FreeBSD will use all available RAM, and reduce the cache > it already does It may seem strange since it's generally accepted that you can never have enough disk cache, but FreeBSD apparently doesn't actually use all the free memory for caching. By default it uses up to 256MB for buffering/caching and there's no way it can use all available memory on i386 in machines with more than 1GB installed since the buffer/cache is allocated from KVM and the default maximum is 1GB. You can increase the amount of memory used, but it might not help - there's a thread on performance@ from 2004 which describes how it all works; see http://lists.freebsd.org/pipermail/freebsd-performance/2004-April/000785.html The information there is quite old now though so I don't know if things are done differently in 6.x. -- Bruce