Re: High CPU consumption in cascade replication with large number of walsenders and ConditionVariable broadcast issues

From: Alexey Makhmutov <a(dot)makhmutov(at)postgrespro(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: High CPU consumption in cascade replication with large number of walsenders and ConditionVariable broadcast issues
Date: 2025-03-30 22:19:29
Message-ID: 4ddbd5f9-aeec-4cfe-8145-d60e06633428@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> We’ve prepared two test patches on top of current master to address
both issues:
> ...
> * 0002-Implement-batching-for-cascade-replication.patch – test patch
to implement possible batching approach in xlogreceiver.c with timer.
Currently it uses GUC variables to allow testing of different batch
sizes and timeout values.

I've played with the second patch a little more and made some
adjustments to it:
1. Setup timer only if we actually have applied messages, which are
(potentially) not yet signaled to walsenders.
2. Notify logical walsenders without delay if time line has changed.

Modified patch is attached.

Thanks,
Alexey

Attachment Content-Type Size
0002-Implement-batching-for-cascade-replication-2.patch text/x-patch 7.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rahila Syed 2025-03-30 23:01:33 Re: Improve monitoring of shared memory allocations
Previous Message Andrew Dunstan 2025-03-30 22:05:57 Re: Non-text mode for pg_dumpall