how unsafe (or worst scenarios) when setting fsync OFF for postgresql

Поиск
Список
Период
Сортировка
От Guoping Zhang
Тема how unsafe (or worst scenarios) when setting fsync OFF for postgresql
Дата
Msg-id 003b01c669c4$34bbd7b0$74304c93@eddy
обсуждение исходный текст
Ответы Re: how unsafe (or worst scenarios) when setting fsync  (Simon Riggs <simon@2ndquadrant.com>)
Re: how unsafe (or worst scenarios) when setting fsync OFF for postgresql  ("Guillaume Smet" <guillaume.smet@gmail.com>)
Re: how unsafe (or worst scenarios) when setting fsync OFF for postgresql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
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


В списке pgsql-performance по дате отправления:

Предыдущее
От: Dan Gorman
Дата:
Сообщение: Re: Running on an NFS Mounted Directory
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: how unsafe (or worst scenarios) when setting fsync