Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id BE34C2E0045 for ; Mon, 14 Apr 2008 16:32:59 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 19931-03 for ; Mon, 14 Apr 2008 16:31:58 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id BF6A22E0039 for ; Mon, 14 Apr 2008 16:31:58 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m3EJVsEM021221; Mon, 14 Apr 2008 15:31:54 -0400 (EDT) To: Gregory Stark cc: "Gaetano Mendola" , pgsql-performance@postgresql.org Subject: Re: shared_buffers performance In-reply-to: <87r6d8hfgw.fsf@oxford.xeocode.com> References: <48032021.90704@gmail.com> <87r6d8hfgw.fsf@oxford.xeocode.com> Comments: In-reply-to Gregory Stark message dated "Mon, 14 Apr 2008 11:56:47 +0100" Date: Mon, 14 Apr 2008 15:31:54 -0400 Message-ID: <21220.1208201514@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/182 X-Sequence-Number: 29675 Gregory Stark writes: > The transition domain where performance drops dramatically as the database > starts to not fit in shared buffers but does still fit in filesystem cache. It looks to me like the knee comes where the DB no longer fits in filesystem cache. What's interesting is that there seems to be no synergy at all between shared_buffers and the filesystem cache. Ideally, very hot pages would stay in shared buffers and drop out of the kernel cache, allowing you to use a database approximating all-of-RAM before you hit the performance wall. It's clear that in this example that's not happening, or at least that only a small part of shared buffers isn't getting duplicated in filesystem cache. Of course, that's because pgbench reads a randomly-chosen row of "accounts" in each transaction, so that there's exactly zero locality of access. A more realistic workload would probably have a Zipfian distribution of account number touches, and might look a little better on this type of test. regards, tom lane