X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id DBCFAD1B4F2 for ; Mon, 6 Oct 2003 19:15:27 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 27083-10 for ; Mon, 6 Oct 2003 16:14:40 -0300 (ADT) Received: from chimta03.algx.net (mta8.algx.net [67.92.168.237]) by svr1.postgresql.org (Postfix) with ESMTP id 95C24D1B4E9 for ; Mon, 6 Oct 2003 16:14:38 -0300 (ADT) Received: from JSH ([67.92.23.74]) by chimmx03.algx.net (iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003)) with SMTP id <0HMC0027QO4E3T@chimmx03.algx.net> for pgsql-performance@postgresql.org; Mon, 06 Oct 2003 14:14:39 -0500 (CDT) Date: Mon, 06 Oct 2003 15:14:38 -0400 From: Jason Hihn Subject: Re: reindex/vacuum locking/performance? In-reply-to: <29923.1065464770@sss.pgh.pa.us> To: Tom Lane , Neil Conway Cc: Andrew Sullivan , PostgreSQL Performance Message-id: MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/189 X-Sequence-Number: 3937 Stepping out on a limb... (I'm not a disk kernel guy) I have long thought that as part of a cache descriptor, there should be a process-definable replacement-strategy (RS). Each cache entry would be associated to each process's replacement-strategy variable and the page-replacement algorithm would then take into consideration the desired policy. Imagine for simplicity sake, that each strategy gets its own cache table. When it comes time to replace a page, the system scans the cache tables, picks the most likely page for replacement from each table, then selects the most likely page between all policies. This allows the 99% of apps that can make excellent use of use LRU to use LRU among themselves (best for everyone), and the MRU (better for databases) (best for everyone too) to only sacrifice the best pages between MRU apps. Though, once you have an MRU process, the final decision between taking the page should be use MRU, and not LRU. Of course there are a number of questions: does each RS get its own table, to be managed independently, or can we combine them all into one table? What are the performance implications of the multiple table management? One day, I'd like to see function pointers and kernel modules used as ways for apps to manage replacement policy. fantasyland# insmod MRU.o fantasyland# vi postgresql.conf { replacement_policy=MRU } {meanwhile in some postgre .c file:} set_cache_policy(get_cfg_replacement_policy()); fantasyland# service postmaster restart Anyone want to throw this at the kernel developers? > -----Original Message----- > From: pgsql-performance-owner@postgresql.org > [mailto:pgsql-performance-owner@postgresql.org]On Behalf Of Tom Lane > Sent: Monday, October 06, 2003 2:26 PM > To: Neil Conway > Cc: Andrew Sullivan; PostgreSQL Performance > Subject: Re: [PERFORM] reindex/vacuum locking/performance? > > > Neil Conway writes: > > On Sun, 2003-10-05 at 19:50, Neil Conway wrote: > > I was hoping you'd reply to this, Tom -- you were referring to O_DIRECT, > > right? > > Not necessarily --- as you point out, it's not clear that O_DIRECT would > help us. What would be way cool is something similar to what James > Rogers was talking about: a way to tell the kernel not to promote this > page all the way to the top of its LRU list. I'm not sure that *any* > Unixen have such an API, let alone one that's common across more than > one platform :-( > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >