pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tim Ellis <Tim.Ellis@gamet.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: FAQ Q
Date: Mon, 10 Jun 2002 17:16:23 -0400
Message-ID: <8872.1023743783@sss.pgh.pa.us> (raw)
In-Reply-To: <20020610124654.44d7b7fb.Tim.Ellis@gamet.com>
References: <20020610124654.44d7b7fb.Tim.Ellis@gamet.com>

Tim Ellis <Tim.Ellis@gamet.com> writes:
> (in summation...) So if data consistency is the most important thing to
> me, performance be damned, I still, as of 7.2.1, want to run in fsync
> mode?

Yup.  no-fsync is only suitable if you trust your OS and power supply.

You do not have to trust Postgres itself: in all cases we push the log
entries out to the OS before declaring a transaction committed.  The
question at hand is whether we use fsync() or other methods to try to
force the OS to write to disk before we report the transaction
committed.  Without that, a system-level crash immediately after a
commit report might mean the "committed" transaction isn't reflected as
committed on disk. 

The performance cost of fsync is not nearly what it used to be pre-7.1,
btw, because we need flush only the WAL log file not data files.
(In case of a crash, any missing data-file updates will be reconstructed
from the recent WAL entries during restart.)  So the needed disk head
movement is a lot less than it used to be --- especially if you've
arranged for pg_xlog to live on its own disk.  I don't think there's any
longer a good argument for considering no-fsync in production servers,
even though you might well still choose it for development systems.

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <8872.1023743783@sss.pgh.pa.us>
Permalink:  ../8872.1023743783@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8872.1023743783@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Tim.Ellis@gamet.com
  Subject: Re: FAQ Q
  In-Reply-To: <8872.1023743783@sss.pgh.pa.us>
  References: <20020610124654.44d7b7fb.Tim.Ellis@gamet.com> <8872.1023743783@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox