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 227F1D1BA48; Thu, 18 Mar 2004 20:09:37 +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 91181-09; Thu, 18 Mar 2004 16:09:37 -0400 (AST) Received: from candle.pha.pa.us (candle.pha.pa.us [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 42F16D1C9D7; Thu, 18 Mar 2004 16:09:27 -0400 (AST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id i2IK9PJ24080; Thu, 18 Mar 2004 15:09:25 -0500 (EST) From: Bruce Momjian Message-Id: <200403182009.i2IK9PJ24080@candle.pha.pa.us> Subject: Re: [HACKERS] fsync method checking In-Reply-To: <20040318200359.GA8330@ping.be> To: Kurt Roeckx Date: Thu, 18 Mar 2004 15:09:25 -0500 (EST) Cc: Tom Lane , 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/265 X-Sequence-Number: 6121 Kurt Roeckx wrote: > On Thu, Mar 18, 2004 at 02:22:10PM -0500, Bruce Momjian wrote: > > > > OK, what better test do you suggest? Right now, there has been no > > testing of these. > > I suggest you start by doing atleast preallocating a 16 MB file > and do the tests on that, to atleast be somewhat simular to what > WAL does. > > I have no idea what the access pattern is for normal WAL > operations or how many times it gets synched. Does it only do > f(data)sync() at commit time, or for every block it writes? > > I think if you write more data you'll see more differences > between O_(D)SYNC and f(data)sync(). > > I guess it can depend on if you have lots of small transactions, > or more big ones. > > Atleast try to make something that covers different access > patterns. OK, I preallocated 16mb. New results: Simple write timing: write 0.037900 Compare fsync times on write() and non-write() descriptor: (If the times are similar, fsync() can sync data written on a different descriptor.) write, fsync, close 0.692942 write, close, fsync 0.762524 Compare one o_sync write to two: one 16k o_sync write 8.494621 two 8k o_sync writes 4.177680 Compare file sync methods with one 8k write: (o_dsync unavailable) open o_sync, write 1.836835 (fdatasync unavailable) write, fsync, 1.780872 Compare file sync methods with 2 8k writes: (The fastest should be used for wal_sync_method) (o_dsync unavailable) open o_sync, write 4.255614 (fdatasync unavailable) write, fsync, 2.120843 -- 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