X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 2DCB89FB6B0 for ; Fri, 1 Sep 2006 18:44:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 36074-05 for ; Fri, 1 Sep 2006 18:43:58 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 230EB9FA0B9 for ; Fri, 1 Sep 2006 17:02:43 -0300 (ADT) Received: (qmail 21524 invoked from network); 1 Sep 2006 20:02:43 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 1 Sep 2006 20:02:43 -0000 In-Reply-To: <87veo7a5dn.fsf@meuh.mnc.lan> References: <87veo7a5dn.fsf@meuh.mnc.lan> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <3743D7B4-2749-41C3-ADE1-39B86F7C98D4@fastcrypt.com> Cc: pgsql-performance@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: increasing shared buffers: how much should be removed from OS filesystem cache? Date: Fri, 1 Sep 2006 16:02:41 -0400 To: Guillaume Cottenceau X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.04 tagged_above=0 required=5 tests=AWL, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/10 X-Sequence-Number: 20696 Guillaume 1G is really not a significant amount of memory these days, That said 6-10% of available memory should be given to an 8.0 or older version of postgresql Newer versions work better around 25% I'm not sure what you mean by mechanically removed from effective_cache effective cache is really a representation of shared buffers plus OS cache Dave On 1-Sep-06, at 1:00 PM, Guillaume Cottenceau wrote: > Hi, > > I've been looking at the results from the pg_statio* tables, to > view the impact of increasing the shared buffers to increase > performance. > > As expected, increasing from the default by a factor of 10~20 > moves table/index disk blocks reads to cache hits, but the > overall service time of my test page is not changed (I'm testing > with a set of queries implying an increase of 170,000 of > sum(heap_blks_hit) and 2,000 of sum(idx_blks_hit) from > pg_statio_user_tables). > > I've seen that documentation says: > > data that is not in the PostgreSQL buffer cache may still > reside in the kernel's I/O cache, and may therefore still be > fetched without requiring a physical read > > I guess this is the best explanation (btw, my test machine runs > Linux 2.6 on 1G of RAM), but I'm still wondering what should be > expected from moving caching from OS filesystem to PG - probably > PG can "cleverly" flush its cache when it is full (e.g. table > data before index data maybe?), whereas the OS will do it > "blindly", but I'm wondering about the limits of this behaviour, > particularly considering that being "very clever" about cache > flush would probably need realtime query statistics which I am > not sure PG does. > > After all, memory added to shared buffers should be mecanically > removed from effective cache size (or others), so I cannot just > increase it until the OS cannot cache anymore :) > > -- > Guillaume Cottenceau > > ---------------------------(end of > broadcast)--------------------------- > TIP 4: Have you searched our list archives? > > http://archives.postgresql.org >