Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 84CB12E0043 for ; Tue, 26 Feb 2008 19:03:19 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 01804-07 for ; Tue, 26 Feb 2008 19:03:16 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 698F92E003E for ; Tue, 26 Feb 2008 19:03:16 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m1QN1wrG009502; Tue, 26 Feb 2008 18:01:58 -0500 (EST) To: Joel Stevenson cc: pgsql-performance@postgresql.org Subject: Re: LISTEN / NOTIFY performance in 8.3 In-reply-to: References: <5576.1203795335@sss.pgh.pa.us> <6730.1203829093@sss.pgh.pa.us> <5080.1204047806@sss.pgh.pa.us> Comments: In-reply-to Joel Stevenson message dated "Tue, 26 Feb 2008 14:18:07 -0800" Date: Tue, 26 Feb 2008 18:01:58 -0500 Message-ID: <9501.1204066918@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/359 X-Sequence-Number: 28901 Joel Stevenson writes: > What's really baffling is that there are plenty of other OLTP queries > going in multiple backends simultaneously that don't fall over my > 300ms query log threshold, and yet NOTIFY and LISTEN consistently do. > What's more it's looks like it's only happening for registered > listener relnames. Hmm, that says that it's not a matter of locking on pg_listener, but of actually applying the row update(s) and/or signaling the recipient(s). If you're not seeing performance issues for ordinary table-update operations it's hard to see why pg_listener updates would be any worse, so that seems to point the finger at the signaling. Which is just a matter of a kill(2) and shouldn't be that expensive. It might be interesting to try strace'ing the whole PG process tree while these notifies are going on, and seeing if you can identify any specific kernel calls that seem to take a long time. regards, tom lane