Re: win32 performance - fsync question - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: win32 performance - fsync question
Date
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE476915@algol.sollentuna.se
Whole thread Raw
In response to win32 performance - fsync question  ("E.Rodichev" <er@sai.msu.su>)
List pgsql-hackers
>> One point that I no longer recall the reasoning behind is that xlog.c
>> doesn't think O_SYNC is a preferable default over fsync.
>
>For larger (>8k) transactions O_SYNC|O_DIRECT is only good
>with the recent
>pending patch to group WAL writes together. The fsync method
>gives the OS a
>chance to do the grouping. (Of course it does not matter if
>you have small
>tx < 8k WAL)

This would be true for fdatasync() but not for fsync(), I think.

On win32 (which started this discussion, fsync will sync the directory
entry as well, which will lead to *at least* two seeks on the disk.
Writing two blocks after each other to an O_SYNC opened file should give
exactly two seeks.

Of course, this only moves the breakpoint up to n blocks, where n > 2 (3
or 4 depending on how many seeks the filesystem will require).

//Magnus


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: SMP buffer management test question
Next
From: Bruce Momjian
Date:
Subject: Re: Query optimizer 8.0.1 (and 8.0)