Skip site navigation (1) Skip section navigation (2)

Re: [COMMITTERS] pgsql: Make walsender more responsive.

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Robert Haas <rhaas(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Make walsender more responsive.
Date: 2012-07-02 17:53:25
Message-ID: 201207021953.25468.andres@2ndquadrant.com (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
On Monday, July 02, 2012 07:19:19 PM Fujii Masao wrote:
> On Mon, Jul 2, 2012 at 10:49 PM, Robert Haas <rhaas(at)postgresql(dot)org> wrote:
> > Make walsender more responsive.
> > 
> > Per testing by Andres Freund, this improves replication performance
> > and reduces replication latency and latency jitter.  I was a bit
> > concerned about moving more work into XLogInsert, but testing seems
> > to show that it's not a problem in practice.
> > 
> > Along the way, improve comments for WaitLatchOrSocket.
> 
> This commit makes the synchronous replication slow down very much
> when wal_sync_method is set to open_sync or open_datasync. I think
> the attached patch needs to be applied.
Hm. Yes, definitely. No idea why I placed the call there, sorry.

Thats how synchronous_write=off behaved generally till the recent (simple) fix 
btw ;)

> +#define WalSndWakeupProcessRequests()		\
> +	do										\
> +	{										\
> +		if (wake_wal_senders)				\
> +		{									\
> +			wake_wal_senders = false;		\
> +			if (max_wal_senders > 0)		\
> +				WalSndWakeup();				\
> +		}									\
> +	} while (0)
> 
> I'm not sure it's really worth doing, but isn't it good idea to test
> max_wal_sender > 0 first to eliminate any CPU cycle in non replication
> case?
I think the difference is ignorable. wake_wal_senders probably has better 
cache locality but is set to true more often, but not that often...

Thanks,

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

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2012-07-02 17:56:36
Subject: Re: Event Triggers reduced, v1
Previous:From: Fujii MasaoDate: 2012-07-02 17:19:19
Subject: Re: [COMMITTERS] pgsql: Make walsender more responsive.

pgsql-committers by date

Next:From: Peter EisentrautDate: 2012-07-02 18:02:39
Subject: pgsql: Add missing space in event_source GUC description.
Previous:From: Fujii MasaoDate: 2012-07-02 17:19:19
Subject: Re: [COMMITTERS] pgsql: Make walsender more responsive.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group