Re: WALWriteLock contention

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WALWriteLock contention
Date: 2015-05-17 20:23:08
Message-ID: D1385D38-E1CC-4099-BD45-CF020EEED4F5@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On May 17, 2015, at 11:04 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Sun, May 17, 2015 at 7:45 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> >
> > <crazy-idea>I wonder if we could write WAL to two different files in
> > alternation, so that we could be writing to one file which fsync-ing
> > the other.</crazy-idea>
>
> Won't the order of transactions replay during recovery can cause
> problems if we do alternation while writing. I think this is one of
> the reasons WAL is written sequentially. Another thing is that during
> recovery, currently whenever we encounter mismatch in stored CRC
> and actual record CRC, we call it end of recovery, but with writing
> to 2 files simultaneously we might need to rethink that rule.

Well, yeah. That's why I said it was a crazy idea.

> I think first point in your mail related to rewrite of 8K block each
> time needs more thought and may be some experimentation to
> check whether writing in lesser units based on OS page size or
> sector size leads to any meaningful gains. Another thing is that
> if there is high write activity, then group commits should help in
> reducing IO for repeated writes and in the tests we can try by changing
> commit_delay to see if that can help (if the tests are already tuned
> with respect to commit_delay, then ignore this point).

I am under the impression that using commit_delay usefully is pretty hard but, of course, I could be wrong.

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2015-05-17 21:36:20 Re: Problems with question marks in operators (JDBC, ECPG, ...)
Previous Message José Luis Tallón 2015-05-17 19:31:47 Re: RFC: Non-user-resettable SET SESSION AUTHORISATION