Re: FYI: fdatasync vs sync_file_range

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: FYI: fdatasync vs sync_file_range
Date: 2009-07-06 10:01:26
Message-ID: 4A51CB76.5020407@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujii Masao wrote:
> According to the result, using sync_file_range instead of fdatasync
> has little effect in the performance of postgres.

When we flush the WAL, we flush everything we've written that far. I'm
not surprised that sync_file_range makes no difference; it does the same
amount of I/O as fsync().

sync_file_range() might be a useful useful replacement for the data file
fsync()s at checkpoint, though. You could avoid the I/O storm that
fsync() causes by flushing the files in smaller chunks with
sync_file_range(), with a small delay in between. But since I don't
recall any complaints about I/O storms at checkpoints since the smoothed
checkpoints patch in 8.3, it might not be worth it.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-07-06 10:25:59 Re: FYI: fdatasync vs sync_file_range
Previous Message Fujii Masao 2009-07-06 08:54:30 FYI: fdatasync vs sync_file_range