Re: initdb and fsync

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org, Jeff Davis <pgsql(at)j-davis(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: initdb and fsync
Date: 2012-03-16 15:47:06
Message-ID: CA+TgmoYqLpagU3GSvvxbHPs9UhQq4QSYCvdD=qj6UiAyPFJTEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 16, 2012 at 6:25 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
>> > How are the results with sync_file_range(fd, 0, 0,
>> > SYNC_FILE_RANGE_WRITE)?
>> That is much faster than using fadvise. It goes down to ~2s.
>
>> Unfortunately, that's non-portable. Any other ideas? 6.5s a little on
>> the annoying side (and causes some disconcerting sounds to come from my
>> disk), especially when we _know_ it can be done in 2s.
> Its not like posix_fadvise is actually portable. So I personally don't see a
> problem with that, but...

Well, sync_file_range only works on Linux, and will probably never
work anywhere else. posix_fadvise() at least has a chance of being
supported on other platforms, being a standard and all that. Though I
see that my Mac has neither. :-(

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-03-16 15:51:04 Re: initdb and fsync
Previous Message Dimitri Fontaine 2012-03-16 15:37:43 Re: Command Triggers, v16