Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nTme4-0006UC-FW for pgsql-general@arkaria.postgresql.org; Mon, 14 Mar 2022 15:30:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nTme3-0004Fj-E2 for pgsql-general@arkaria.postgresql.org; Mon, 14 Mar 2022 15:30:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nTme3-0004Fa-40 for pgsql-general@lists.postgresql.org; Mon, 14 Mar 2022 15:30:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nTme0-0002kU-Tn for pgsql-general@postgresql.org; Mon, 14 Mar 2022 15:30:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 22EFTsGB179962; Mon, 14 Mar 2022 11:29:54 -0400 From: Tom Lane To: =?UTF-8?B?0JDRgNGB0LXQvSDQkNGA0YPRgtGO0L3Rj9C9?= cc: =?UTF-8?B?cGdzcWwtZ2VuZXJhbA==?= Subject: Re: =?UTF-8?B?TElTVEVOL05PVElGWSB1bHRyYSBzbG93IHNwZWVk?= In-reply-to: <1647262405.342456086@f759.i.mail.ru> References: <1647262405.342456086@f759.i.mail.ru> Comments: In-reply-to =?UTF-8?B?0JDRgNGB0LXQvSDQkNGA0YPRgtGO0L3Rj9C9?= message dated "Mon, 14 Mar 2022 15:53:25 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <179960.1647271794.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 14 Mar 2022 11:29:54 -0400 Message-ID: <179961.1647271794@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =3D?UTF-8?B?0JDRgNGB0LXQvSDQkNGA0YPRgtGO0L3Rj9C9?=3D writes= : > =C2=A0 =C2=A0=C2=A0Hello! I'm having trouble with LISTEN/NOTIFY speed. N= ow I have about 100-200 (few?) clients who are actively messaging. But rec= ently I started to notice a drop in speed. Changing the log_min_duration_s= tatement parameter did not show slow queries in the log. > =C2=A0 =C2=A0=C2=A0As it turned out, the pg_notify(text ,text) function > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0or the > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0NOTIFY text, 'text' queries=C2=A0= takes an extremely long time (0.7-1.5sec), > =C2=A0 =C2=A0=C2=A0but the select pg_notification_queue_usage() query=C2= =A0always returns 0. What PG version is this exactly? What is in $PGDATA/pg_notify/ ? regards, tom lane