Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id A85399FB78F for ; Sat, 12 May 2007 13:55:48 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 44364-05 for ; Sat, 12 May 2007 13:55:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 4F0379FB6B5 for ; Sat, 12 May 2007 13:55:45 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 5EB6256462; Sat, 12 May 2007 11:55:44 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Sat, 12 May 2007 11:55:41 -0500 Date: Sat, 12 May 2007 11:55:41 -0500 From: "Jim C. Nasby" To: Heikki Linnakangas Cc: Michael van Rooyen , pgsql-performance@postgresql.org Subject: Re: Kernel cache vs shared_buffers Message-ID: <20070512165540.GD52939@nasby.net> References: <00b301c79486$1c54da80$0200a8c0@saturn> <4645CF1D.1030309@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4645CF1D.1030309@enterprisedb.com> X-Operating-System: FreeBSD 6.1-RELEASE-p10 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.13 (2006-08-11) X-Hashcash: 1:20:070512:heikki@enterprisedb.com::nw8oaUT6icvpXSun:00000000000000 0000000000000000000000000lbr X-Hashcash: 1:20:070512:mvanr@bigfoot.com::6tVHb/Uq9a9pFh/B:00000000000000000000 00000000000000000000000016iR X-Hashcash: 1:20:070512:pgsql-performance@postgresql.org::eCodlf8nJmapbybi:00000 0000000000000000000000006ApH X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/241 X-Sequence-Number: 24631 On Sat, May 12, 2007 at 03:28:45PM +0100, Heikki Linnakangas wrote: > >In the case of it being disk-block based, my > >inclination would be to let the kernel do the buffering. In the case of > >the cache being table-row-based, I would expect it to be much more > >space-efficient and I would be inclined to give the memory to the pg. > >In that case, is it feasible to set shared_buffers to something like > >500000 x 8k blocks? We make extensive use of indexes on the larger > >tables and would seldom, if ever, do sequential scans. > > A common rule of thumb people quote here is to set shared_buffers to 1/4 > of available RAM, and leave the rest for OS cache. That's probably a > good configuration to start with. If you really care about performance it would be a good idea to start with that and do your own benchmarking. Much of the consensus about shared_buffers was built up before 8.0, and the shared buffer management we have today looks nothing like what was in 7.4. You might find that shared_buffers = 50% of memory or even higher might perform better for your workload. If you do find results like that, please share them. :) -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)