Skip site navigation (1) Skip section navigation (2)

Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
Date: 2004-09-13 20:28:05
Message-ID: 414602D5.3000506@bigfoot.com (view raw or flat)
Thread:
Lists: 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








In response to

Responses

pgsql-performance by date

Next:From: Josh BerkusDate: 2004-09-13 21:15:59
Subject: Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
Previous:From: mudfootDate: 2004-09-13 19:32:44
Subject: Re: Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group