On Sat, 2012-01-28 at 13:18 -0500, Tom Lane wrote:
> Yeah. Personally I would be sad if initdb got noticeably slower, and
> I've never seen or heard of a failure that this would fix.
I worked up a patch, and it looks like it does about 6 file fsync's and
a 7th for the PGDATA directory. That degrades the time from about 1.1s
to 1.4s on my workstation.
pg_test_fsync says this about my workstation (one 8kB write):
open_datasync 117.495 ops/sec
fdatasync 117.949 ops/sec
fsync 25.530 ops/sec
open_sync 24.666 ops/sec
25 ops/sec means about 40ms per fsync, times 7 is about 280ms, so that
seems like about the right degradation for fsync. I tried with fdatasync
as well to see if it improved things, and I wasn't able to realize any
difference (not sure exactly why).
So, is it worth it? Should we make it an option that can be specified?
> I wonder whether it wouldn't be sufficient to call sync(2) at the end,
> anyway, rather than cluttering the entire initdb codebase with fsync
It looks like there are only a few places, so I don't think clutter is
really the problem with the simple patch at this point (unless there is
a portability problem with just calling fsync).
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2012-02-05 00:30:35|
|Subject: Re: Patch: Allow SQL-language functions to reference parameters by parameter name |
|Previous:||From: Florian Weimer||Date: 2012-02-04 21:20:05|
|Subject: Re: initdb and fsync|