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

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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, 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 18:50:23
Message-ID: CA+Tgmob69X5VkULo4WTjTZEns8WxXdJVOKgLfcsDjyAu7NzLxA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
On Mon, Jul 2, 2012 at 1:53 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>> 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.

Committed.

>> +#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...

I was wondering if we shouldn't do this as:

if (max_wal_senders > 0 && wake_wal_senders)
    WalSndWakeup();

....and then put wake_wal_senders = false into WalSndWakeup().

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2012-07-02 19:45:28
Subject: Re: Ability to listen on two unix sockets
Previous:From: Robert HaasDate: 2012-07-02 18:42:12
Subject: Re: Event Triggers reduced, v1

pgsql-committers by date

Next:From: Magnus HaganderDate: 2012-07-02 19:16:51
Subject: Re: pgsql: Add missing space in event_source GUC description.
Previous:From: Robert HaasDate: 2012-07-02 18:48:57
Subject: pgsql: Fix position of WalSndWakeupRequest call.

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