Search Postgresql Archives

Re: Excessive (and slow) fsync() within single transaction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Thu, Dec 10, 2009 at 8:38 AM, Greg Smith <greg@xxxxxxxxxxxxxxx> wrote:
PostgreSQL on OS X uses a special fsync method by default named 'fsync_writethrough'.  If you do this on your database you should be able to confirm it's using it:

show wal_sync_method;

This method includes a call to Apple's API to make sure the cache is properly flushed on the drives.  Lots more details about how all this works at http://www.westnet.com/~gsmith/content/postgresql/TuningPGWAL.htm
 

 # show wal_sync_method;
 wal_sync_method
-----------------
 open_datasync

I don't think I have done anything to change this method from the default compile settings.

From the documentation:
http://www.postgresql.org/docs/8.4/static/runtime-config-wal.html#RUNTIME-CONFIG-WAL-SETTINGS

·         open_datasync (write WAL files with open() option O_DSYNC)

·         fdatasync (call fdatasync() at each commit)

·         fsync_writethrough (call fsync() at each commit, forcing write-through of any disk write cache)

·         fsync (call fsync() at each commit)

·         open_sync (write WAL files with open() option O_SYNC)

Not all of these choices are available on all platforms. The default is the first method in the above list that is supported by the platform.

So apparently, my system supports open_datasync, and since it is the first method, that is the default.


Stephen



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux