X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 112FA329E01 for ; Mon, 13 Sep 2004 21:36:48 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 33467-09 for ; Mon, 13 Sep 2004 20:36:41 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id A7C91329C83 for ; Mon, 13 Sep 2004 21:36:42 +0100 (BST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i8DKaeCn036561 for ; Mon, 13 Sep 2004 20:36:40 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i8DKSAgj033605 for pgsql-performance@postgresql.org; Mon, 13 Sep 2004 20:28:10 GMT From: Gaetano Mendola X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options Date: Mon, 13 Sep 2004 22:28:05 +0200 Organization: PYRENET Midi-pyrenees Provider Lines: 86 Message-ID: <414602D5.3000506@bigfoot.com> References: <1095055866.414539fadb90d@webmail.rawbw.com> <200409131438.i8DEc8r04384@candle.pha.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@pyrenet.fr To: Bruce Momjian User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en In-Reply-To: <200409131438.i8DEc8r04384@candle.pha.pa.us> X-Enigmail-Version: 0.85.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/91 X-Sequence-Number: 8219 Bruce Momjian wrote: > Have you seen /src/tools/fsync? > Now that the argument is already open, why postgres choose on linux fdatasync? I'm understanding from other posts that on this platform open_sync is better than fdatasync. However I choose open_sync. During initdb why don't detect this parameter ? Regards Gaetano Mendola These are my times: kernel 2.4.9-e.24smp ( RAID SCSI ): Simple write timing: write 0.011544 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 1.233312 write, close, fsync 1.242086 Compare one o_sync write to two: one 16k o_sync write 0.517633 two 8k o_sync writes 0.824603 Compare file sync methods with one 8k write: (o_dsync unavailable) open o_sync, write 0.438580 write, fdatasync 1.239377 write, fsync, 1.178017 Compare file sync methods with 2 8k writes: (o_dsync unavailable) open o_sync, write 0.818720 write, fdatasync 1.395602 write, fsync, 1.351214 kernel 2.4.22-1.2199.nptlsmp (single EIDE disk): Simple write timing: write 0.023697 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.688765 write, close, fsync 0.702166 Compare one o_sync write to two: one 16k o_sync write 0.498296 two 8k o_sync writes 0.543956 Compare file sync methods with one 8k write: (o_dsync unavailable) open o_sync, write 0.259664 write, fdatasync 0.971712 write, fsync, 1.006096 Compare file sync methods with 2 8k writes: (o_dsync unavailable) open o_sync, write 0.536882 write, fdatasync 1.160347 write, fsync, 1.189699