Re: Excessive (and slow) fsync() within single transaction - Mailing list pgsql-general

From Stephen Tyler
Subject Re: Excessive (and slow) fsync() within single transaction
Date
Msg-id 51549ea20912091521m6481980cic013d560519c001d@mail.gmail.com
Whole thread Raw
In response to Re: Excessive (and slow) fsync() within single transaction  (Greg Smith <greg@2ndquadrant.com>)
List pgsql-general

On Thu, Dec 10, 2009 at 8:38 AM, Greg Smith <greg@2ndquadrant.com> 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


pgsql-general by date:

Previous
From: DM
Date:
Subject: Install compat-postgresql-libs-debuginfo on postgres 8.3.8 without using RPM
Next
From: Craig Ringer
Date:
Subject: Re: pg_dump and ON DELETE CASCADE problem