Re: WalSndWakeup() and synchronous_commit=off - Mailing list pgsql-hackers

From Andres Freund
Subject Re: WalSndWakeup() and synchronous_commit=off
Date
Msg-id 201205112001.17903.andres@2ndquadrant.com
Whole thread Raw
In response to Re: WalSndWakeup() and synchronous_commit=off  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: WalSndWakeup() and synchronous_commit=off
List pgsql-hackers
On Friday, May 11, 2012 07:20:26 PM Robert Haas wrote:
> On Fri, May 11, 2012 at 1:09 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
> > Calling WalSndWakeup() while WALWriteLock is being held might cause
> > another performance degradation. No?
> 
> That definitely doesn't seem ideal - a lot of things can pile up
> behind WALWriteLock.  I'm not sure how big a problem it would be in
> practice, but we generally make a practice of avoiding sending signals
> while holding LWLocks whenever possible...
In my measurements on moderately powerful hardware I couldn't see any 
degradation on the primary - in fact the contrary, but the improvements were 
around 0.4% and I only tested 10min so its not exactly hard evidence. But I 
aggree its not ideal.
Its the only place though which knows whether its actually sensible to wakeup 
the walsender. We could make it return whether it wrote anything and do the 
wakeup at the callers. I count 4 different callsites which would be an 
annoying duplication but I don't really see anything better right now.

Better Ideas?

Andres

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


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Gsoc2012 idea, tablesample
Next
From: Jeff Janes
Date:
Subject: Re: Draft release notes complete