X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3907DD1B80B; Thu, 18 Mar 2004 17:34:52 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 46844-03; Thu, 18 Mar 2004 13:34:50 -0400 (AST) Received: from candle.pha.pa.us (candle.pha.pa.us [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 7754CD1BAC8; Thu, 18 Mar 2004 13:34:44 -0400 (AST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id i2IHYaR29308; Thu, 18 Mar 2004 12:34:36 -0500 (EST) From: Bruce Momjian Message-Id: <200403181734.i2IHYaR29308@candle.pha.pa.us> Subject: Re: [HACKERS] fsync method checking In-Reply-To: <46C15C39FEB2C44BA555E356FBCD6FA40184CF68@m0114.s-mxs.net> To: Zeugswetter Andreas SB SD Date: Thu, 18 Mar 2004 12:34:36 -0500 (EST) Cc: Mark Kirkwood , pgsql-performance@postgresql.org, PostgreSQL-development X-Mailer: ELM [version 2.4ME+ PL108 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/255 X-Sequence-Number: 6111 I have updated my program with your suggested changes and put in src/tools/fsync. Please see how you like it. --------------------------------------------------------------------------- Zeugswetter Andreas SB SD wrote: > > > Running the attached test program shows on BSD/OS 4.3: > > > > write 0.000360 > > write & fsync 0.001391 > > I think the "write & fsync" pays for the previous "write" test (same filename). > > > write, close & fsync 0.001308 > > open o_fsync, write 0.000924 > > I have tried to modify the program to more closely resemble WAL > writes (all writes to WAL are 8k), the file is usually already open, > and test larger (16k) transactions. > > zeu@a82101002:~> test_sync1 > write 0.000625 > write & fsync 0.016748 > write & fdatasync 0.006650 > write, close & fsync 0.017084 > write, close & fdatasync 0.006890 > open o_dsync, write 0.015997 > open o_dsync, one write 0.007128 > > For the last line xlog.c would need to be modified, but the measurements > seem to imply that it is only worth it on platforms that have O_DSYNC > but not fdatasync. > > Andreas Content-Description: test_sync1.c [ Attachment, skipping... ] -- 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