Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D89D7476574 for ; Tue, 10 Sep 2002 13:18:10 -0400 (EDT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id 093CF476571 for ; Tue, 10 Sep 2002 13:18:09 -0400 (EDT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g8AHHuV29296; Tue, 10 Sep 2002 13:17:56 -0400 (EDT) From: Bruce Momjian Message-Id: <200209101717.g8AHHuV29296@candle.pha.pa.us> Subject: Re: fsync or fdatasync In-Reply-To: <20020910180957.Y24188@vestdata.no> To: =?ISO-8859-1?Q?Ragnar_Kj=F8rstad?= Date: Tue, 10 Sep 2002 13:17:56 -0400 (EDT) Cc: Gaetano Mendola , pgsql-admin@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UNKNOWN-8BIT X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/111 X-Sequence-Number: 5650 Ragnar Kjørstad wrote: > On Tue, Sep 10, 2002 at 11:40:24AM -0400, Bruce Momjian wrote: > > > > The original poster was wrong about the default. > > > > We use fdatasync where available, and fsync when it is not. > > Makes sense. > > > We also use > > O_SYNC on open if it is available. > > Why? That will slow tings down... Actually, no, we are only O_SYNC'ing the WAL writes and sometimes that is faster because you are not writing then fsyncing, you are just writing. The fdatasync only is better than O_SYNC when you are doing multiple WAL writes before an fdatasync and we normally don't do that. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073