X-Original-To: pgsql-performance@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 730B847747C for ; Thu, 30 Jan 2003 18:18:56 -0500 (EST) Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) by postgresql.org (Postfix) with ESMTP id 02490475E45 for ; Thu, 30 Jan 2003 18:18:56 -0500 (EST) Received: from DU150.N224.ResNet.QueensU.CA (DU150.N224.ResNet.QueensU.CA [130.15.224.150]) by bob.samurai.com (Postfix) with ESMTP id 66E1A1F68; Thu, 30 Jan 2003 18:18:57 -0500 (EST) Subject: Re: Postgres 7.3.1 poor insert/update/search performance From: Neil Conway To: Andrew Sullivan Cc: pgsql-performance@postgresql.org In-Reply-To: <20030122070524.F27014@mail.libertyrms.com> References: <13165.1043188295@sss.pgh.pa.us> <1CE2D1AE-2DAB-11D7-BE6C-000393D9FD00@mobygames.com> <20030122070524.F27014@mail.libertyrms.com> Content-Type: text/plain Organization: Message-Id: <1043968734.3123.27.camel@tokyo> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.1 Date: 30 Jan 2003 18:18:54 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/396 X-Sequence-Number: 1043 On Wed, 2003-01-22 at 07:05, Andrew Sullivan wrote: > (As you point out, this caclulation is complicated by the potential to > waste memory by caching the data twice If we had a good buffer replacement algorithm (which we currently do not), ISTM that hot pages retained in PostgreSQL's buffer cache would never get loaded from the OS's IO cache, thus causing those pages to eventually be evicted from the OS's cache. So the "cache the data twice" problem doesn't apply in all circumstances. > Some systems, like Solaris, allow you to turn off the > disk cache, so the problem may not be one you face.) I think it would be interesting to investigate disabling the OS' cache for all relation I/O (i.e. heap files, index files). That way we could both improve performance (by moving all the caching into PostgreSQL's domain, where there is more room for optimization), as well as make configuration simpler: in an ideal world, it would remove the need to consider the OS' caching when configuring the amount of shared memory to allocate to PostgreSQL. Can this be done using O_DIRECT? If so, is it portable? BTW, if anyone has any information on actually *using* O_DIRECT, I'd be interested in it. I tried to quickly hack PostgreSQL to use it, without success... Cheers, Neil -- Neil Conway || PGP Key ID: DB3C29FC