fsync vs open_sync

From: pgsql(at)mohawksoft(dot)com
To: pgsql-hackers(at)postgresql(dot)org
Subject: fsync vs open_sync
Date: 2004-08-09 18:27:00
Message-ID: 5646.64.119.142.34.1092076020.squirrel@mail.mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2004-08-09 19:04:18 Re: Beta Leader?
Previous Message pgsql 2004-08-09 18:18:17 fsync vs open_sync