Re: Reduced power consumption in WAL Writer process

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Peter Geoghegan <peter(at)2ndquadrant(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reduced power consumption in WAL Writer process
Date: 2011-07-17 21:27:38
Message-ID: CA+U5nMKkzyffenhm2M7s5BeggOHWYJiA9dS96Shg9Jq===8sqw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 15, 2011 at 6:33 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Jul 15, 2011, at 8:55 AM, Simon Riggs <simon(at)2ndQuadrant(dot)com> wrote:
>>> The only difference is how bulk write operations are handled. As long
>>> as we wake WALWriter before wal_buffers fills then we'll be good.
>>> Wakeup once per wal buffer is too much. I agree we should measure this
>>> to check how frequently wakeups are required for bulk ops.
>
>> Yeah. The trick is to get the wake-ups to be frequent enough without
>> adding too much latency to the backends that have to perform them. Off-hand,
>> I don't  have a good feeling for how hard that will be.
>
> I'd say send the signal when wal buffers are more than X% full (maybe
> half).  The suggestion to send it when wrapping around at the end of the
> array is not quite right, because that's an arbitrary condition that's
> not related to how much work there is for the walwriter to do.  It
> should be cheap to check for this while advancing to a new wal buffer.

Yes, I was trying to go too simple.

I think we need to put the calculation and SetLatch() after we release
WALInsertLock, so as to avoid adding contention.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-07-17 21:39:02 Re: Re: patch review : Add ability to constrain backend temporary file space
Previous Message Tom Lane 2011-07-17 21:10:02 Re: [COMMITTERS] pgsql: Add temp_file_limit GUC parameter to constrain temporary file sp