pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Арсен Арутюнян <arutar@bk.ru>
To: pgsql-general <pgsql-general@postgresql.org>
Cc: tgl@sss.pgh.pa.us
Subject: Re[2]: LISTEN/NOTIFY ultra slow speed
Date: Tue, 15 Mar 2022 13:39:24 +0300
Message-ID: <1647340764.254194077@f561.i.mail.ru> (raw)
In-Reply-To: <1647329663.754713354@f111.i.mail.ru>
References: <1647262405.342456086@f759.i.mail.ru>
	<1647329663.754713354@f111.i.mail.ru>


i looked at the file "\src\backend\commands\async.c"
there is a check for duplicate messages
 
/******** PG 10
if (AsyncExistsPendingNotify(channel, payload))
return;
***********/
 
/******** PG 13
if (AsyncExistsPendingNotify(n))
{
…...
}
***********/
Is this slowdown related to this check?
Is it possible to skip the check if I'm absolutely sure the message is unique?
 
 
--
Arsen Arutyunyan
 
  
>Вторник, 15 марта 2022, 10:34 +03:00 от Арсен Арутюнян <arutar@bk.ru>:
> 
> 
>1)
>select version();
>                          version
>------------------------------------------------------------
> PostgreSQL 10.6, compiled by Visual C++ build 1800, 64-bit
> 
>2) $PGDATA/pg_notify/
>Sometimes this folder is empty, sometimes it contains the file I have attached. The file is always less than 200kb
> 
> 
>--
>Arsen Arutyunyan
> 
> 
>>Понедельник, 14 марта 2022, 15:53 +03:00 от Арсен Арутюнян < arutar@bk.ru >:
>> 
>>    Hello! I'm having trouble with LISTEN/NOTIFY speed. Now I have about 100-200 (few?) clients who are actively messaging. But recently I started to notice a drop in speed. Changing the log_min_duration_statement parameter did not show slow queries in the log.
>>    As it turned out, the pg_notify(text ,text) function
>>          or the
>>          NOTIFY text, 'text' queries takes an extremely long time (0.7-1.5sec),
>>    but the select pg_notification_queue_usage() query always returns 0.
>>Please tell me what's the matter, where did I make a mistake? 
>>What needs to be done to increase the speed of adding to the message queue?
>> 
>>--
>>Arsen Arutyunyan
>|What PG version is this exactly?  What is in $PGDATA/pg_notify/ ?
>|            regards, tom lane
> 
 

view thread (2+ messages)  latest in thread

Message-ID: <1647340764.254194077@f561.i.mail.ru>
Permalink:  ../1647340764.254194077@f561.i.mail.ru/
Also on:    postgresql.org/message-id/1647340764.254194077@f561.i.mail.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: arutar@bk.ru, tgl@sss.pgh.pa.us
  Subject: Re: LISTEN/NOTIFY ultra slow speed
  In-Reply-To: <1647340764.254194077@f561.i.mail.ru>
  References: <1647262405.342456086@f759.i.mail.ru> <1647329663.754713354@f111.i.mail.ru> <1647340764.254194077@f561.i.mail.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox