Re: AW: AW: AW: WAL does not recover gracefully from ou t-of -dis k-sp ace

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: AW: AW: AW: WAL does not recover gracefully from ou t-of -dis k-sp ace
Date: 2001-03-10 02:53:12
Message-ID: 13368.984192792@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM> writes:
>> $ gcc -Wall -O -DINIT_WRITE -DUSE_DSYNC -DBLOCKS=1 tfsync.c
> ^^^^^^^^^^^
> You should use -DUSE_OSYNC to test O_SYNC.

Ooops ... let's hear it for cut-and-paste, and for sharp-eyed readers!

Just for completeness, here are the results for O_SYNC:

$ gcc -Wall -O -DINIT_WRITE -DUSE_OSYNC -DBLOCKS=1 tfsync.c
$ time a.out

real 0m43.44s
user 0m0.02s
sys 0m0.74s
$ gcc -Wall -O -DINIT_WRITE -DUSE_OSYNC -DBLOCKS=4 tfsync.c
$ time a.out

real 0m26.38s
user 0m0.01s
sys 0m0.59s
$ gcc -Wall -O -DINIT_WRITE -DUSE_OSYNC -DBLOCKS=8 tfsync.c
$ time a.out

real 0m23.86s
user 0m0.01s
sys 0m0.59s

$ gcc -Wall -O -DINIT_WRITE -DUSE_OSYNC -DBLOCKS=64 tfsync.c
$ time a.out

real 0m22.93s
user 0m0.01s
sys 0m0.66s

Better than fsync(), but still not up to O_DSYNC.

> So seems we can use O_DSYNC without losing log write performance
> comparing with write() + fsync. Though, we didn't tested write() +
> fdatasync() yet...

Good point, we should check fdatasync() too --- although I have no
machines where it's different from fsync().

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikheev, Vadim 2001-03-10 04:15:14 RE: AW: AW: AW: WAL does not recover gracefully from ou t-of -dis k-sp ace
Previous Message Mikheev, Vadim 2001-03-10 02:45:36 RE: AW: AW: AW: WAL does not recover gracefully from ou t-of -dis k-sp ace