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

Re: [HACKERS] no universally correct setting for fsync

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-docs(at)postgresql(dot)org
Subject: Re: [HACKERS] no universally correct setting for fsync
Date: 2010-05-08 00:02:59
Message-ID: 4BE4AA33.7020700@agliodbs.com (view raw or flat)
Thread:
Lists: pgsql-docspgsql-hackers
Folks,

This is what I have to replace the current fsync entry in config.sgml.

I believe that the note about needing fsync for Warm Standby to work
correctly is true, but could someone verify it?

=========================

     <varlistentry id="guc-fsync" xreflabel="fsync">
      <indexterm>
       <primary><varname>fsync</> configuration parameter</primary>
      </indexterm>
      <term><varname>fsync</varname> (<type>boolean</type>)</term>
      <listitem>
       <para>
        If this parameter is on, the <productname>PostgreSQL</> server
        will try to make sure that updates are physically written to
        disk, by issuing <function>fsync()</> system calls or various
        equivalent methods (see <xref linkend="guc-wal-sync-method">).
        This ensures that the database cluster can recover to a
        consistent state after an operating system or hardware crash.
       </para>

       <para>
        While turning off <varname>fsync</varname> is often a performance
        benefit, this can result in unrecoverable data corruption in the
event
        of an unexpected shutdown. Thus it is only advisable to turn off
        <varname>fsync</varname> if you can easily recreate
        your entire database from external data.  <varname>fsync</varname>
        must be on for WAL archiving to work correctly
        (see <xref linkend="continuous-archiving">).
       <para>

       <para>
        In many situations, turning off <xref
linkend="guc-synchronous-commit">
        for noncritical transactions can provide much of the potential
        performance benefit of turning off <varname>fsync</varname>, without
        the attendant risks of data corruption.
       </para>

       <para>
        <varname>fsync</varname> can only be set in the
<filename>postgresql.conf</>
        file or on the server command line.
        If you turn this parameter off, also consider turning off
        <xref linkend="guc-full-page-writes">.
       </para>
      </listitem>
     </varlistentry>

-- 
                                  -- Josh Berkus
                                     PostgreSQL Experts Inc.
                                     http://www.pgexperts.com

In response to

Responses

pgsql-docs by date

Next:From: Tom LaneDate: 2010-05-08 00:13:32
Subject: Re: [HACKERS] no universally correct setting for fsync
Previous:From: Tom LaneDate: 2010-05-07 23:49:15
Subject: Re: no universally correct setting for fsync

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-05-08 00:13:32
Subject: Re: [HACKERS] no universally correct setting for fsync
Previous:From: Tom LaneDate: 2010-05-07 23:49:15
Subject: Re: no universally correct setting for fsync

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