Re: walsender performance regression due to logical decoding on standby changes

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: walsender performance regression due to logical decoding on standby changes
Дата
Msg-id 20230519.120756.337226894962602552.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Re: walsender performance regression due to logical decoding on standby changes  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы RE: walsender performance regression due to logical decoding on standby changes  ("Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>)
Re: walsender performance regression due to logical decoding on standby changes  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
At Thu, 18 May 2023 20:11:11 +0530, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote in 
> > > +             ConditionVariableInit(&WalSndCtl->physicalWALSndCV);
> > > +             ConditionVariableInit(&WalSndCtl->logicalWALSndCV);
> >
> > It's not obvious to me that it's worth having two CVs, because it's more
> > expensive to find no waiters in two CVs than to find no waiters in one CV.
> 
> I disagree. In the tight per-WAL record recovery loop, WalSndWakeup
> wakes up logical walsenders for every WAL record, but it wakes up
> physical walsenders only if the applied WAL record causes a TLI
> switch. Therefore, the extra cost of spinlock acquire-release for per
> WAL record applies only for logical walsenders. On the other hand, if
> we were to use a single CV, we would be unnecessarily waking up (if at
> all they are sleeping) physical walsenders for every WAL record -
> which is costly IMO.

As I was reading this, I start thinking that one reason for the
regression could be to exccessive frequency of wakeups during logical
replication. In physical replication, we make sure to avoid exccessive
wakeups when the stream is tightly packed.  I'm just wondering why
logical replication doesn't (or can't) do the same thing, IMHO.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



 



В списке pgsql-hackers по дате отправления:

Предыдущее
От: jian he
Дата:
Сообщение: Re: PG 16 draft release notes ready
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: PG 16 draft release notes ready