From owner-freebsd-database@FreeBSD.ORG Fri Jul 25 01:55:58 2003 Return-Path: Delivered-To: freebsd-database@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F30537B401; Fri, 25 Jul 2003 01:55:58 -0700 (PDT) Received: from misery.sdf.com (misery.sdf.com [207.200.153.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 400F043F3F; Fri, 25 Jul 2003 01:55:56 -0700 (PDT) (envelope-from tom@sdf.com) Received: from tom (helo=localhost) by misery.sdf.com with local-esmtp (Exim 2.12 #1) id 19fwc6-0004gx-00; Fri, 25 Jul 2003 00:03:38 -0700 Date: Fri, 25 Jul 2003 00:03:32 -0700 (PDT) From: Tom Samplonius To: Christopher Weimann In-Reply-To: <20030724173910.GA9364@smtp.k12us.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Sean Chittenden cc: freebsd-database@freebsd.org cc: freebsd-performance@freebsd.org cc: Terry Lambert cc: Paul Pathiakis Subject: Re: Tuning for PostGreSQL Database X-BeenThere: freebsd-database@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Database use and development under FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jul 2003 08:55:59 -0000 On Thu, 24 Jul 2003, Christopher Weimann wrote: ... > So if PostGreSQL uses fsync when writing ( which I think is only true > on the write-ahead logs at this point ) that data will NOT wind up in > the cache. Anything that PostGreSQL reads should wind up in the cache? > > #uname -r > 4.7-RELEASE-p3 > > # top -b | head -5 > last pid: 58622; load averages: 1.96, 1.67, 1.47 up 2+12:59:15 13:31:39 > 130 processes: 6 running, 124 sleeping > > Mem: 348M Active, 2628M Inact, 438M Wired, 155M Cache, 380M Buf, 76M Free > Swap: 4096M Total, 28K Used, 4096M Free > > The 2628M Inact is likley to be acting as cache? > > Basically I should stop worrying about this :) Maybe you should continue to worry. PostgreSQL isn't MySQL (or a typical server application). It reads all database pages into its shared memory area. It is wasteful for the DBMS and the OS to both cache this data. You'll want the PostgreSQL shared memory size to be around 75% the size of RAM (on a dedicated DBMS server). In fact, many commercial DBMS systems will use raw writes to bypass the OS cache! Tom