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

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Robert Haas <rhaas(at)postgresql(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Make walsender more responsive.
Date: 2012-07-02 17:19:19
Message-ID: CAHGQGwF4=d8XpW5bwUTn=eanpg9E+t-FM_L597WcJ4adx8K5-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

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.

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

Regards,

--
Fujii Masao

Attachment Content-Type Size
bugfix_v1.patch application/octet-stream 616 bytes

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2012-07-02 17:53:25 Re: [COMMITTERS] pgsql: Make walsender more responsive.
Previous Message David Fetter 2012-07-02 15:49:05 Re: [COMMITTERS] pgsql: Make walsender more responsive.

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-07-02 17:53:25 Re: [COMMITTERS] pgsql: Make walsender more responsive.
Previous Message Nils Goroll 2012-07-02 17:19:18 away soon - spinlock->pthread_mutex : first results with Jeff's pgbench+plsql