From owner-freebsd-questions@FreeBSD.ORG Fri Nov 16 12:13:30 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 5297A16A41B for ; Fri, 16 Nov 2007 12:13:30 +0000 (UTC) (envelope-from gandalf@shopzeus.com) Received: from viefep31-int.chello.at (viefep31-int.chello.at [62.179.121.49]) by mx1.freebsd.org (Postfix) with ESMTP id 8C47513C4BE for ; Fri, 16 Nov 2007 12:13:29 +0000 (UTC) (envelope-from gandalf@shopzeus.com) Received: from [192.168.2.175] (really [80.99.169.3]) by viefep31-int.chello.at (InterMail vM.7.08.02.02 201-2186-121-104-20070414) with ESMTP id <20071116121247.HGGQ16570.viefep31-int.chello.at@[192.168.2.175]>; Fri, 16 Nov 2007 13:12:47 +0100 Message-ID: <473D8940.3030501@shopzeus.com> Date: Fri, 16 Nov 2007 13:12:48 +0100 From: Laszlo Nagy User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Bruce Cran , freebsd-questions@freebsd.org References: <473C7C0A.4060708@shopzeus.com> <20071115182220.E60452@wojtek.tensor.gdynia.pl> <473CAF70.1090006@cran.org.uk> In-Reply-To: <473CAF70.1090006@cran.org.uk> Content-Type: text/plain; charset=windows-1250; format=flowed Content-Transfer-Encoding: 8bit Cc: 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: Fri, 16 Nov 2007 12:13:30 -0000 Bruce Cran írta: > 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. OK, and how about amd64 arch? The reason I ask this is that we have a big postresql database (over 3GB) and PostgreSQL rely on the OS for caching files in memory. This database is mostly read-only, so it would be nice to use all free memory for caching. Especially that this machine is the database server, it does nothing else. Now, it is an i386 but we are about to migrate to AMD X2, then we can put in 8GB of memory. But only if the OS can use if for caching. Otherwise it would be useless. Thank you for the link. That thread is quite old - things might have changed. Thanks, Laszlo