Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id AD0ED9FB319 for ; Sat, 12 May 2007 11:29:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 81792-08 for ; Sat, 12 May 2007 11:28:50 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by postgresql.org (Postfix) with ESMTP id 8AD449FB317 for ; Sat, 12 May 2007 11:28:56 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id k3so747214ugf for ; Sat, 12 May 2007 07:28:54 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=i6F7n0o4FQK2O2lObb6WwBnkGlaPa58k1FrVQIrT3Xj5xlm1i0fuc0MdILQXsR/0FAwaBoLxkqOCmScUwUS2wzLzslXCOFG3QNrH8h5dfFhcdjx52Z/vplKwC53De5D5kL/lvI+xLTL03WIt0RS/2arwPb2ubocUNvIu2DHrfs0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=RkuZVa9LRzE41nBJrPuTmzjXMfcohmJAm7mV8HADkI9fOYHBfn36AWSUWv7W6ApcqYav6CzsyCMSI8f4ZCG/pKojCJXWYJ6EVViQdD+Ewg6xdktkv3nAwm+HZRzcIkPQaFOLs0h2V0tBCxf2qWRqOEYyUezFG/OVWU5nTBuv8A8= Received: by 10.66.249.16 with SMTP id w16mr3675298ugh.1178980134463; Sat, 12 May 2007 07:28:54 -0700 (PDT) Received: from ?192.168.1.33? ( [82.9.23.211]) by mx.google.com with ESMTP id b23sm1054109ugd.2007.05.12.07.28.51; Sat, 12 May 2007 07:28:53 -0700 (PDT) Message-ID: <4645CF1D.1030309@enterprisedb.com> Date: Sat, 12 May 2007 15:28:45 +0100 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: Michael van Rooyen CC: pgsql-performance@postgresql.org Subject: Re: Kernel cache vs shared_buffers References: <00b301c79486$1c54da80$0200a8c0@saturn> In-Reply-To: <00b301c79486$1c54da80$0200a8c0@saturn> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/239 X-Sequence-Number: 24629 Michael van Rooyen wrote: > I have no idea regarding the inner working of the pg's shared cache, but > what I would like to find out is whether it is table-row-based, or > disk-block-based. It's block based. > 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. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com