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 7AD7AD1E929; Thu, 18 Mar 2004 18:44:13 +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 71161-03; Thu, 18 Mar 2004 14:44:09 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 79F19D1E2AA; Thu, 18 Mar 2004 14:44:03 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i2IIi2qf011044; Thu, 18 Mar 2004 13:44:02 -0500 (EST) To: Bruce Momjian Cc: Mark Kirkwood , pgsql-performance@postgresql.org, PostgreSQL-development Subject: Re: [HACKERS] fsync method checking In-reply-to: <200403181746.i2IHkDA00975@candle.pha.pa.us> References: <200403181746.i2IHkDA00975@candle.pha.pa.us> Comments: In-reply-to Bruce Momjian message dated "Thu, 18 Mar 2004 12:46:13 -0500" Date: Thu, 18 Mar 2004 13:44:02 -0500 Message-ID: <11043.1079635442@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/258 X-Sequence-Number: 6114 Bruce Momjian writes: > I have been poking around with our fsync default options to see if I can > improve them. One issue is that we never default to O_SYNC, but default > to O_DSYNC if it exists, which seems strange. As I recall, that was based on testing on some different platforms. It's not particularly "strange": O_SYNC implies writing at least two places on the disk (file and inode). O_DSYNC or fdatasync should theoretically be the fastest alternatives, O_SYNC and fsync the worst. > Compare fsync before and after write's close: > write, fsync, close 0.000707 > write, close, fsync 0.000808 What does that mean? You can't fsync a closed file. > This shows terrible O_SYNC performance for 2 8k writes, but is faster > for a single 8k write. Strange. I'm not sure I believe these numbers at all... my experience is that getting trustworthy disk I/O numbers is *not* easy. regards, tom lane