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 F2660D1B43A for ; Fri, 23 Apr 2004 23:50:29 -0300 (ADT) 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 72995-08 for ; Fri, 23 Apr 2004 23:50:31 -0300 (ADT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 98745D1BB16 for ; Fri, 23 Apr 2004 23:50:26 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i3O2oEQD006799; Fri, 23 Apr 2004 22:50:14 -0400 (EDT) To: Ron Mayer Cc: Manfred Koizar , Pallav Kalva , pgsql-performance@postgresql.org Subject: Re: Setting Shared Buffers , Effective Cache, Sort Mem In-reply-to: References: <4088062E.2050901@deg.cc> <4089261A.9070700@deg.cc> Comments: In-reply-to Ron Mayer message dated "Fri, 23 Apr 2004 15:10:20 -0700" Date: Fri, 23 Apr 2004 22:50:14 -0400 Message-ID: <6798.1082775014@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/420 X-Sequence-Number: 6720 Ron Mayer writes: > [ on setting shared_buffers = half of RAM ] > One minor detail... You wouldn't really cache the _exact_ same blocks > because cache-hits in shared-buffers (on the most frequently accessed > pages) would let the OS cache some other pages in it's cache. > But in my experience Manfred's right that there's no benefit and > some penalty to making shared_buffers so large it takes a significant > piece away from the OS's caching. True, it'd probably not be the *exact* worst case. But it'd be a good approximation. In practice you should either bet on the kernel doing most of the caching (in which case you set shared_buffers pretty low) or bet on Postgres doing most of the caching (in which case you set shared_buffers to eat most of RAM). The conventional wisdom at this point is to bet the first way; no one has shown performance benefits from setting shared_buffers higher than the low tens of thousands. (Most of the mail list traffic on this predates the existence of pgsql-performance, so check the other list archives too if you go looking for discussion.) It's possible that Jan's recent buffer-management improvements will change the story as of 7.5. I kinda doubt it myself, but it'd be worth re-running any experiments you've done when you start working with 7.5. regards, tom lane