X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7C8ACD1E106 for ; Thu, 26 Feb 2004 21:58:52 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 20645-01 for ; Thu, 26 Feb 2004 17:58:41 -0400 (AST) Received: from five.zapatec.com (66-117-150-100.web.lmi.net [66.117.150.100]) by svr1.postgresql.org (Postfix) with ESMTP id 68081D1BA21 for ; Thu, 26 Feb 2004 17:58:37 -0400 (AST) Received: from rlx11.zapatec.com (rlx11.pr.zapatec.com [192.168.1.132]) by five.zapatec.com (Postfix) with ESMTP id 0C1075D23 for ; Thu, 26 Feb 2004 13:58:39 -0800 (PST) Received: (from dror@localhost) by rlx11.zapatec.com (8.12.3/8.12.3/Submit) id i1QLwcCE080517 for pgsql-performance@postgresql.org; Thu, 26 Feb 2004 13:58:38 -0800 (PST) (envelope-from dror) Date: Thu, 26 Feb 2004 13:58:38 -0800 From: Dror Matalon To: pgsql-performance@postgresql.org Subject: Re: FreeBSD config Message-ID: <20040226215838.GK26787@rlx11.zapatec.com> References: <20040226180345.GU26787@rlx11.zapatec.com> <20040227054639.H34315-100000@houston.familyhealth.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040227054639.H34315-100000@houston.familyhealth.com.au> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/306 X-Sequence-Number: 5830 On Fri, Feb 27, 2004 at 05:47:47AM +0800, Christopher Kings-Lynne wrote: > > We have postgres running on freebsd 4.9 with 2 Gigs of memory. As per > > repeated advice on the mailing lists we configured effective_cache_size > > = 25520 which you get by doing `sysctl -n vfs.hibufspace` / 8192 > > > > Which results in using 200Megs for disk caching. > > effective_cache_size does nothing of the sort. CHeck your > shared_buffers value... Sigh. http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.html 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://archives.postgresql.org/pgsql-performance/2003-07/msg00159.php talks about how to programmatically determine the right setting for effective_cache_size: case `uname` in "FreeBSD") echo "effective_cache_size = $((`sysctl -n vfs.hibufspace` / 8192))" ;; *) echo "Unable to automatically determine the effective cache size" >> /dev/stderr ;; esac which brings me back to my question why not make Freebsd use more of its memory for disk caching and then tell postgres about it. > > > Is there a reason not to increase the hibufspace beyond the 200 megs and > > provide a bigger cache to postgres? I looked both on the postgres and > > freebsd mailing lists and couldn't find a good answer to this. > > Well, maybe butnot necessarily. It's better to leave the OS to look after > most of your RAM. > > Chris > -- Dror Matalon Zapatec Inc 1700 MLK Way Berkeley, CA 94709 http://www.fastbuzz.com http://www.zapatec.com