X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 18F139FA6B1 for ; Wed, 30 Aug 2006 13:27:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 37441-07 for ; Wed, 30 Aug 2006 16:27:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 48A179FA4A5 for ; Wed, 30 Aug 2006 13:27:00 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 513E45643F; Wed, 30 Aug 2006 11:26:59 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Wed, 30 Aug 2006 11:26:58 -0500 Date: Wed, 30 Aug 2006 11:26:57 -0500 From: "Jim C. Nasby" To: Vivek Khera Cc: Matthew Sullivan , pgsql-performance@postgresql.org Subject: Re: performance problems. Message-ID: <20060830162657.GD81373@pervasive.com> References: <44F55A7F.40305@sorbs.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060830:vivek@khera.org::86xGpwA0dFMl7/fw:00ERS7 X-Hashcash: 1:20:060830:matthew@sorbs.net::JyjSeXGmkfOLT2nr:00000000000000000000 0000000000000000000000000orW X-Hashcash: 1:20:060830:pgsql-performance@postgresql.org::pcorom3hJGvizjc9:00000 0000000000000000000000003lLT X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200608/480 X-Sequence-Number: 20665 On Wed, Aug 30, 2006 at 10:10:28AM -0400, Vivek Khera wrote: > effective_cache_size = 27462 # `sysctl -n > vfs.hibufspace` / 8192 (BLKSZ) > random_page_cost = 2 You misunderstand how effective_cache_size is used. It's the *only* memory factor that plays a role in cost estimator functions. This means it should include the memory set aside for caching in shared_buffers. Also, hibufspace is only talking about filesystem buffers in FreeBSD, which AFAIK has nothing to do with total memory available for caching, since VM pages are also used to cache data. Basically, your best bet for setting effective_cache_size is to use the total memory in the machine, and substract some overhead for the OS and other processes. I'll typically subtract 1G. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461