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 1jucms-0001fe-QE for pgsql-general@arkaria.postgresql.org; Sun, 12 Jul 2020 14:17:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jucmp-0003IJ-JK for pgsql-general@arkaria.postgresql.org; Sun, 12 Jul 2020 14:16:59 +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 1jucmp-0003I8-B0 for pgsql-general@lists.postgresql.org; Sun, 12 Jul 2020 14:16:59 +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 1jucml-0003aj-Re for pgsql-general@postgresql.org; Sun, 12 Jul 2020 14:16:58 +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 06CEGqSW2501820; Sun, 12 Jul 2020 10:16:52 -0400 From: Tom Lane To: Andrew Smith cc: Rita , Brian Dunavant , "pgsql-general@postgresql.org >> PG-General Mailing List" Subject: Re: Listen/Notify feedback In-reply-to: References: Comments: In-reply-to Andrew Smith message dated "Sun, 12 Jul 2020 22:52:30 +1000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2501818.1594563412.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 12 Jul 2020 10:16:52 -0400 Message-ID: <2501819.1594563412@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andrew Smith writes: > A couple of years ago I started looking into listen/notify in PG10 and > found that the throughput decreased quite a bit as I added more and more > listeners. Given the number of apps I needed to have listening and the > number of messages that I expected to be consuming, I ended up writing a > single listener app which then republished the messages via MQTT. Not su= re > if the performance has improved in subsequent versions (or whether this > will affect you at all) but it's something to keep in mind. FWIW, we made some efficiency improvements in v13 for the case of NOTIFY with a lot of listeners [1]. Can't say of course whether that would have fixed your problem, and v13 is still in beta anyway. regards, tom lane [1] https://git.postgresql.org/gitweb/?p=3Dpostgresql.git&a=3Dcommitdiff&h= =3D51004c717