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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: how unsafe (or worst scenarios) when setting fsync OFF for postgresql
Дата
Msg-id 25291.1146200208@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: how unsafe (or worst scenarios) when setting fsync OFF for postgresql  ("Guoping Zhang" <guoping.zhang@nec.com.au>)
Ответы Re: how unsafe (or worst scenarios) when setting fsync OFF for postgresql
Список pgsql-performance
"Guoping Zhang" <guoping.zhang@nec.com.au> writes:
> a) The tests consists of ten thousands very small transactions, which are
> not grouped, that is why so slow with compare to set fsync off.

Yup.

> c) wal_sync_method is set to 'open_datasync', which is fastest among the
> four, right?

Well, is it?  You shouldn't assume that without testing.

> Looks like, if we have to set fsync be true, we need to modify our
> application.

Yes, you should definitely look into batching your operations into
larger transactions.  On normal hardware you can't expect to commit
transactions faster than one per disk revolution (unless they're coming
from multiple clients, where there's a hope of ganging several parallel
commits per revolution).

Or buy a disk controller with battery-backed write cache and put your
faith in that cache surviving a machine crash.  But don't turn off fsync
if you care about your data.

            regards, tom lane

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

Предыдущее
От: "Guoping Zhang"
Дата:
Сообщение: Re: how unsafe (or worst scenarios) when setting fsync OFF for postgresql
Следующее
От: "Guoping Zhang"
Дата:
Сообщение: Re: how unsafe (or worst scenarios) when setting fsync