Re: Latch for the WAL writer - further reducing idle wake-ups.

From: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Latch for the WAL writer - further reducing idle wake-ups.
Date: 2012-05-03 23:49:37
Message-ID: CAEYLb_XvBQpp36-kJv6tBxGHx=D5AKUaijhxTpA=Ztx5QaFBNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3 May 2012 10:56, Magnus Hagander <magnus(at)hagander(dot)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 Content-Type Size
walwriter_latch_v2_2012_05_04.patch application/octet-stream 18.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2012-05-04 00:22:16 Re: Future In-Core Replication
Previous Message Josh Berkus 2012-05-03 21:52:34 Re: Features of Postgresql and Postgres-xc with MySQL