From owner-freebsd-stable@FreeBSD.ORG Mon May 23 18:49:29 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E6B116A41C; Mon, 23 May 2005 18:49:29 +0000 (GMT) (envelope-from sven@dmv.com) Received: from smtp-gw-cl-d.dmv.com (smtp-gw-cl-d.dmv.com [216.240.97.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD38643D48; Mon, 23 May 2005 18:49:28 +0000 (GMT) (envelope-from sven@dmv.com) Received: from lanshark.dmv.com (lanshark.dmv.com [216.240.97.46]) by smtp-gw-cl-d.dmv.com (8.12.10/8.12.10) with ESMTP id j4NInRWa022821; Mon, 23 May 2005 14:49:27 -0400 (EDT) (envelope-from sven@dmv.com) From: Sven Willenberger To: John-Mark Gurney In-Reply-To: <20050523174415.GI959@funkthat.com> References: <1116860293.10083.43.camel@lanshark.dmv.com> <20050523174415.GI959@funkthat.com> Content-Type: text/plain Date: Mon, 23 May 2005 14:50:04 -0400 Message-Id: <1116874204.10077.61.camel@lanshark.dmv.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.48 on 216.240.97.42 Cc: freebsd-stable@freebsd.org, freebsd-amd64@freebsd.org Subject: Re: Manipulating disk cache (buf) settings X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2005 18:49:29 -0000 On Mon, 2005-05-23 at 10:44 -0700, John-Mark Gurney wrote: > Sven Willenberger wrote this message on Mon, May 23, 2005 at 10:58 -0400: > > We are running a PostgreSQL server (8.0.3) on a dual opteron system with > > 8G of RAM. If I interpret top and vfs.hibufspace correctly (which show > > values of 215MB and 225771520 (which equals 215MB) respectively. My > > understanding from having searched the archives is that this is the > > value that is used by the system/kernel in determining how much disk > > data to cache. > > This is incorrect... FreeBSD merged the vm and buf systems a while back, > so all of memory is used as a disk cache.. The buf cache is still used > for filesystem meta data (and for pending writes of files, but those buf's > reference the original page, not local storage)... > > Just as an experiment, on a quiet system do: > dd if=/dev/zero of=somefile bs=1m count=2048 > and then read it back in: > dd if=somefile of=/dev/null bs=1m > and watch systat or iostat and see if any of the file is read... You'll > probably see that none of it is... > Yes, confirmed as stated, this is great news then. In essence the PostgreSQL planner can be told that the effective cache size is *much* larger than that calculated by using vfs.hibufspace; should result in some [hopefully] marked performance boosts. btw: > dd if=/dev/zero of=zerofile bs=1m count=2048 2048+0 records in 2048+0 records out 2147483648 bytes transferred in 43.381462 secs (49502335 bytes/sec) > dd if=zerofile of=/dev/null bs=1m 2048+0 records in 2048+0 records out 2147483648 bytes transferred in 5.304807 secs (404818435 bytes/sec) and that was on a 3GB RAM system so the caching scheme works great. Sven