Re: fsync or fdatasync

Поиск
Список
Период
Сортировка
От Gaetano Mendola
Тема Re: fsync or fdatasync
Дата
Msg-id alil6f$fie$1@news.hub.org
обсуждение исходный текст
Ответ на Re: fsync or fdatasync  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: fsync or fdatasync
Список pgsql-admin
"Tom Lane" <tgl@sss.pgh.pa.us> wrote in message
news:11753.1031590251@sss.pgh.pa.us...
> "Gaetano Mendola" <mendola@bigfoot.com> writes:
> > apparently the default value for wal_sync_method is fsync,
> > and apparently the best method is fdatasync.
>
> Best on what platform, and according to what evidence?

Well, the man say ( Linux ):


fdatasync flushes all data buffers of a file to disk (before the system call
returns).  It resembles fsync but is
       not required to update the metadata such as access time.

       Applications that access databases or log files often write a tiny
data fragment (e.g., one line in a  log  file)
       and  then  call  fsync immediately in order to ensure that the
written data is physically stored on the harddisk.
       Unfortunately, fsync will always initiate two write operations: one
for the newly written data and another one in
       order to update the modification time stored in the inode. If the
modification time is not a part of the transac�
       tion concept fdatasync can be used to avoid unnecessary inode disk
write operations.


So, what is wrong here ? Seems clear that one write is better than two.

Ciao
Gaetano




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

Предыдущее
От: Alex Ott
Дата:
Сообщение: how can i get free space for database?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 7.2.2 upgrade, pg_dumpall / reload problem