pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guoping Zhang <guoping.zhang@nec.com.au>
To: pgsql-performance@postgresql.org
Cc: Guoping Zhang (E-mail) <guopingz@nstc.nec.com.au>
Subject: how unsafe (or worst scenarios) when setting fsync OFF for postgresql
Date: Thu, 27 Apr 2006 16:31:23 +1000
Message-ID: <003b01c669c4$34bbd7b0$74304c93@eddy> (raw)

Hi,.

We are new to Postgresql. I am appreciated if the following question can be
answered.

Our application has a strict speed requirement for DB operation. Our tests
show that it takes about 10secs for the operation when setting fsync off,
but takes about 70 seconds when setting fsync ON (with other WAL related
parametered tuned).

We have to looking at setting fsync OFF option for performance reason,
our questions are

  a) if we set fsync OFF and anything (very low chance though) like OS
crash, loss of power, or hardware fault happened, can postgresql rolls back
to the state that the last checkpoint was done ( but all the operations
after that is lost)

  b) Does this roll back to last checkpoint can ensure the database back to
consistent state?

  c) What is worst scenarios if setting fsync OFF in term of database
safety. We try to avoid to restore the database from nightly backup.

We view our application is not that data loss critical, say loss of five
minutes of data and operation occasionally, but the database integrity and
consistency must be kept.

Can we set fsync OFF for the performance benefit, have the risk of only 5
minutes data loss or much worse?

Thanks in advance.

Regards,

Guoping




view thread (14+ messages)  latest in thread

Message-ID: <003b01c669c4$34bbd7b0$74304c93@eddy>
Permalink:  ../003b01c669c4$34bbd7b0$74304c93@eddy/
Also on:    postgresql.org/message-id/003b01c669c4$34bbd7b0$74304c93@eddy

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: guoping.zhang@nec.com.au, guopingz@nstc.nec.com.au
  Subject: Re: how unsafe (or worst scenarios) when setting fsync OFF for postgresql
  In-Reply-To: <003b01c669c4$34bbd7b0$74304c93@eddy>

* 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