Re: WAL performance with wal_sync_method = open_sync

Lists: pgsql-hackers
From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: WAL performance with wal_sync_method = open_sync
Date: 2001-04-28 12:15:28
Message-ID: 20010428211528H.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

I'm playing with wal parameters and found that wal_sync_method =
open_sync enormously enhance the performance on my machine. Without it
(using default fsync) I got only 90 tps at the best using pgbench (-s
2). However if I set wal_sync_method = open_sync, I get ~200 tps. I
have checked PostgreSQL uses O_SYNC flag when it opens WAL log files
using strace. Can anybody tell me why? I am afraid this is just a
dream:-) Linux kernel 2.2.17.
--
Tatsuo Ishii


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: WAL performance with wal_sync_method = open_sync
Date: 2001-04-30 05:58:38
Message-ID: 10967.988610318@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> writes:
> I'm playing with wal parameters and found that wal_sync_method =
> open_sync enormously enhance the performance on my machine. Without it
> (using default fsync) I got only 90 tps at the best using pgbench (-s
> 2). However if I set wal_sync_method = open_sync, I get ~200 tps.

Wouldn't surprise me. The performance of the fsync method sucks on
my system (HPUX 10.20) as well. AFAICT HPUX and Linux 2.2.x are not
very smart about fsync on large files --- they scan all the kernel
disk buffers for the target file to find the dirty ones. O_SYNC
avoids this scanning.

I hear Linux 2.4.* is smarter about doing fsync, so it probably has
fsync as fast or faster than O_SYNC.

regards, tom lane