Re: Re[2]: LISTEN/NOTIFY ultra slow speed

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Арсен Арутюнян <arutar(at)bk(dot)ru>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Re[2]: LISTEN/NOTIFY ultra slow speed
Date: 2022-03-15 14:32:07
Message-ID: 317665.1647354727@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?UTF-8?B?0JDRgNGB0LXQvSDQkNGA0YPRgtGO0L3Rj9C9?= <arutar(at)bk(dot)ru> writes:
> i looked at the file "\src\backend\commands\async.c"
> there is a check for duplicate messages

Yup.

> Is this slowdown related to this check?

[ shrug... ] You've provided no evidence either for or against that
possibility.

It seems a little unlikely that you could have a lot of pending messages
without also seeing data accumulating in pg_notify/, but on the other hand
it's also hard to think of other places that time could be getting spent
if the queue is always empty. Can you use perf(1) or some such tool to
try to identify where the time is being spent? There's some advice
about that here:

https://wiki.postgresql.org/wiki/Profiling_with_perf

> Is it possible to skip the check if I'm absolutely sure the message is unique?

Not a good idea. You could upgrade to PG 13 or later, where that
code has been improved.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2022-03-15 15:49:57 Re: Restoring using PG_DUMP in PG12 results in
Previous Message Tom Lane 2022-03-15 14:17:46 Re: [External]Re: Postgres Crash Issue