Re: fallocate / posix_fallocate for new WAL file creation (etc...)

From: David Fetter <david(at)fetter(dot)org>
To: Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Jim Nasby <jim(at)nasby(dot)net>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Greg Stark <stark(at)mit(dot)edu>, Amit Kapila <amit(dot)kapila(at)huawei(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jeff Davis <pgsql(at)j-davis(dot)com>, Florian Pflug <fgp(at)phlo(dot)org>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fallocate / posix_fallocate for new WAL file creation (etc...)
Date: 2013-05-14 02:41:37
Message-ID: 20130514024137.GA24304@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 13, 2013 at 08:54:39PM -0500, Jon Nelson wrote:
> Pertinent to another thread titled
> [HACKERS] corrupt pages detected by enabling checksums
> I hope to explore the possibility of using fallocate (or
> posix_fallocate) for new WAL file creation.
>
> Most modern Linux filesystems support fast fallocate/posix_fallocate,
> reducing extent fragmentation (where extents are used) and frequently
> offering a pretty significant speed improvement. In my tests, using
> posix_fallocate (followed by pg_fsync) is at least 28 times quicker
> than using the current method (which writes zeroes followed by
> pg_fsync).
>
> I have written up a patch to use posix_fallocate in new WAL file
> creation, including configuration by way of a GUC variable, but I've
> not contributed to the PostgreSQL project before. Therefore, I'm
> fairly certain the patch is not formatted properly or conforms to the
> appropriate style guides. Currently, the patch is based on 9.2, and is
> quite small in size - 3.6KiB.
>
> Advice on how to proceed is appreciated.

Thanks for hopping in!

Please re-base the patch vs. git master, as new features like this go
there. Please also to send along the tests you're doing so others can
riff. Tests that find any weak points are also good.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2013-05-14 02:58:21 Re: PostgreSQL 9.3 beta breaks some extensions "make install"
Previous Message Tom Lane 2013-05-14 02:38:32 Re: commit fest schedule for 9.4