Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options - Mailing list pgsql-performance

From Gaetano Mendola
Subject Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
Date
Msg-id 414602D5.3000506@bigfoot.com
Whole thread Raw
In response to Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
List pgsql-performance
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








pgsql-performance by date:

Previous
From: mudfoot@rawbw.com
Date:
Subject: Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
Next
From: Josh Berkus
Date:
Subject: Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options