fsync vs open_sync

Поиск
Список
Период
Сортировка
От pgsql@mohawksoft.com
Тема fsync vs open_sync
Дата
Msg-id 5646.64.119.142.34.1092076020.squirrel@mail.mohawksoft.com
обсуждение исходный текст
Ответы Re: fsync vs open_sync  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: fsync vs open_sync  (Mark Kirkwood <markir@coretech.co.nz>)
Re: fsync vs open_sync (more info)  (pgsql@mohawksoft.com)
Список pgsql-hackers
I did a little test on the various options of fsync.

I'm not sure my tests are scientific enough for general publication or
evaluation, all I am doing is performaing a loop that inserts a value into
a table 1 million times.
create table testndx (value integer, name varchar);
create index testndx_val on testndx (value);

for(int i=0; i < 1000000; i++)
{ printf_query( "insert into testndx (value, name) values ('%d', 'test')",
random());
  // report here
}


Anyway, with fsync enabled using standard fsync(), I get roughly 300-400
inserts per second. With fsync disabled, I get about 7000 inserts per
second. When I re-enable fsync but use the open_sync option, I can get
about 2500 inserts per second.

(This is on Linux 2.4 kernel, ext2 file system)

(1) Is there any drawback to using open_sync as it appears to be a happy
medium to turing fsync off?
(2) Does anyone know if the "open_sync" option performs this well across
most platforms or only Linux?
(3) If "open_sync" works well across many platforms, and there are no
drawbacks, shouldn't it be the default wal sync method? The performance
bood is increadible.


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

Предыдущее
От: pgsql@mohawksoft.com
Дата:
Сообщение: fsync vs open_sync
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: VACUUM DELAY