Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UMnea-0000kJ-R3 for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2013 22:56:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UMnea-0001bQ-6a for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2013 22:56:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UMneY-0001bI-7A for pgsql-hackers@postgresql.org; Mon, 01 Apr 2013 22:56:38 +0000 Received: from 99-153-64-76.uvs.austtx.sbcglobal.net ([99.153.64.76] helo=noel.decibel.org) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UMneO-0008QE-FY for pgsql-hackers@postgresql.org; Mon, 01 Apr 2013 22:56:36 +0000 Received: from decibook.local (rrcs-67-79-71-90.sw.biz.rr.com [67.79.71.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by noel.decibel.org (Postfix) with ESMTPSA id AB4F96D489; Mon, 1 Apr 2013 22:56:22 +0000 (UTC) Message-ID: <515A1093.8090403@nasby.net> Date: Mon, 01 Apr 2013 17:56:19 -0500 From: Jim Nasby User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: Ants Aasma CC: Merlin Moncure , Tom Lane , Atri Sharma , Greg Stark , Amit Kapila , PostgreSQL-development Subject: Re: Page replacement algorithm in buffer cache References: <08BBC126-D375-4743-B9A6-D1320D05D5C7@gmail.com> <514c3395.487a420a.28d1.764eSMTPIN_ADDED_BROKEN@mx.google.com> <3985.1363960959@sss.pgh.pa.us> <29181.1363981925@sss.pgh.pa.us> <29748.1363983378@sss.pgh.pa.us> <514D29CB.5080600@nasby.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.9 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 3/23/13 7:41 AM, Ants Aasma wrote: > On Sat, Mar 23, 2013 at 6:04 AM, Jim Nasby wrote: >> Partitioned clock sweep strikes me as a bad idea... you could certainly get >> unlucky and end up with a lot of hot stuff in one partition. > > Surely that is not worse than having everything in a single partition. > Given a decent partitioning function it's very highly unlikely to have > more than a few of the hottest buffers end up in a single partition. One could argue that it is worse because you've added another layer of unpredictability to performance. If something happens to suddenly put two heavily hit sets in the same partition your previously good performance suddenly tanks. Maybe that issue isn't real enough to be worth worrying about, but I still think it'd be easier and cleaner to try keeping stuff on the free list first... >> Another idea that'sbeen broughht up inthe past is to have something in the >> background keep a minimum number of buffers on the free list. That's how OS >> VM systems I'm familiar with work, so there's precedent for it. >> >> I recall there were at least some theoretical concerns about this, but I >> don't remember if anyone actually tested the idea. > > Yes, having bgwriter do the actual cleaning up seems like a good idea. > The whole bgwriter infrastructure will need some serious tuning. There > are many things that could be shifted to background if we knew it > could keep up, like hint bit setting on dirty buffers being flushed > out. But again, we have the issue of having good tests to see where > the changes hurt. I think at some point we need to stop depending on just bgwriter for all this stuff. I believe it would be much cleaner if we had separate procs for everything we needed (although some synergies might exist; if we wanted to set hint bits during write then bgwriter *is* the logical place to put that). In this case, I don't think keeping stuff on the free list is close enough to checkpoints that we'd want bgwriter to handle both. At most we might want them to pass some metrics back in forth. -- -- Jim C. Nasby, Data Architect jim@nasby.net 512.569.9461 (cell) http://jim.nasby.net -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers