From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 17 16:03:09 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B504216A4CE for ; Wed, 17 Mar 2004 16:03:09 -0800 (PST) Received: from rlx13.zapatec.com (66-117-144-213.zapatec.lmi.net [66.117.144.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B1FC43D2F for ; Wed, 17 Mar 2004 16:03:09 -0800 (PST) (envelope-from dror@rlx11.zapatec.com) Received: from rlx11.zapatec.com (rlx11.pr.zapatec.com [192.168.1.132]) by rlx13.zapatec.com (Postfix) with ESMTP id 63D07A941 for ; Wed, 17 Mar 2004 16:03:09 -0800 (PST) Received: (from dror@localhost) by rlx11.zapatec.com (8.12.3/8.12.3/Submit) id i2I038DA008752 for freebsd-hackers@freebsd.org; Wed, 17 Mar 2004 16:03:08 -0800 (PST) (envelope-from dror) Date: Wed, 17 Mar 2004 16:03:08 -0800 From: Dror Matalon To: freebsd-hackers@freebsd.org Message-ID: <20040318000308.GT1757@rlx11.zapatec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: Configuring disk cache size on postgress X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2004 00:03:09 -0000 Hi Folks, When configuring postgres, one of the variables to configure is effective_cache_size: Sets the optimizer's assumption about the effective size of the disk cache (that is, the portion of the kernel's disk cache that will be used for PostgreSQL data files). This is measured in disk pages, which are normally 8 kB each. (http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.html) The conventional wisdom on the postgres list has been that for freebsd you calculate this by doing `sysctl -n vfs.hibufspace` / 8192). Now I'm running 4.9 with 2 Gig of ram and sysctl -n vfs.hibufspace indicates usage of 200MB. Questions: 1. How much RAM is freebsd using for *disk* caching? Is it part of the general VM or is it limited to the above 200MB? I read Matt Dillon's http://www.daemonnews.org/200001/freebsd_vm.html, but most of the discussion there seems to be focused on caching programs and program data. 2. Can I tell, and if so how, how much memory the OS is using for disk caching? 3. What are the bufspace variables for? This subject has been touched on before in http://unix.derkeiler.com/Mailing-Lists/FreeBSD/performance/2003-09/0045.html which point to a patch to increase the bufspace, but these messages don't quite answer my questions. Regards, Dror -- Dror Matalon Zapatec Inc 1700 MLK Way Berkeley, CA 94709 http://www.fastbuzz.com http://www.zapatec.com