Re: Latch for the WAL writer - further reducing idle wake-ups. - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Latch for the WAL writer - further reducing idle wake-ups.
Date
Msg-id CAEYLb_XvBQpp36-kJv6tBxGHx=D5AKUaijhxTpA=Ztx5QaFBNg@mail.gmail.com
Whole thread Raw
In response to Re: Latch for the WAL writer - further reducing idle wake-ups.  (Magnus Hagander <magnus@hagander.net>)
Responses Re: Latch for the WAL writer - further reducing idle wake-ups.
Re: Latch for the WAL writer - further reducing idle wake-ups.
List pgsql-hackers
On 3 May 2012 10:56, Magnus Hagander <magnus@hagander.net> wrote:
> I agree that it's ok to slip it in given that it's "finishing off a
> patch from earlier". I think it's reasonable to hold it to a little
> bit higher review stadards since it's that late in the cycle though,
> such as two people reviewing it before it goes in (or 1 reviewer + 1
> committer - and of course, unless it's a truly trivial patch). Which
> it seems you both are doing now, so that makes it ok ;)

Right. It's a simple, largely mechanical patch, that doesn't have any
behavioural changes, and is of strategic importance, so I thought it
was worthy of special consideration, without actually expecting it.

Attached patch removes the questionable SetLatch() call, under the
assumption that it's okay if the WALWriter, having entered hibernation
due to sustained inactivity (10 seconds) subsequently takes up to 5
seconds (2.5 on average) to notice that it has work to do. These
values may need to be tweaked. I have not bothered with making the
sleep time adaptive, because it's probably too late to do that.

This latest revision also covers the checkpointer. The code for that
is far simpler than that for the WAL Writer, so it doesn't
particularly feel like I'm pushing my luck by slipping that into
something to be slipped in. I should not have excluded it before,
since it accounts for another 2 wake-ups per second. All told, this
new revision sees Postgres wake-ups stabilise at 0.9 per second. With
the checkpointer code included, we roundly beat MySQL in this area,
which will be a nice advocacy message for 9.2, though I probably
shouldn't be quoted on that until I get the opportunity to go back and
make absolutely sure that I've been fair.

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services

Attachment

pgsql-hackers by date:

Previous
From: Daniel Farina
Date:
Subject: Re: CLOG extension
Next
From: Greg Smith
Date:
Subject: Re: Future In-Core Replication