Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 419F12E009C for ; Tue, 26 Feb 2008 13:45:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 22020-01-10 for ; Tue, 26 Feb 2008 13:45:26 -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 00B362E00B7 for ; Tue, 26 Feb 2008 13:44:49 -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 m1QHhQGg005081; Tue, 26 Feb 2008 12:43:26 -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> Comments: In-reply-to Joel Stevenson message dated "Tue, 26 Feb 2008 08:26:30 -0800" Date: Tue, 26 Feb 2008 12:43:26 -0500 Message-ID: <5080.1204047806@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/346 X-Sequence-Number: 28888 Joel Stevenson writes: > Now that I see a little bit more of what goes on under the hood of > this function I see that it's still basically table-driven and I'll > adjust my expectations accordingly, Yeah, there's been discussion of replacing the implementation with some all-in-memory queue kind of setup, but no one's got round to that yet. > With ps I can see some postgres backends with a 'notify interrupt > waiting' command line during the tests - could it be an issue with > signal handling on the original machine - something entirely outside > of PG's control? No, that's not unexpected if you have the same notify being delivered to multiple processes that had been idle. They'll all get wakened and try to read pg_listener to see what happened, but since this is a read-modify-write type of operation it uses an exclusive lock, so only one can clear its pg_listener entry at a time. The 'waiting' ones you are seeing are stacked up behind whichever one has the lock at the moment. They shouldn't be waiting for long. I'm still baffled by why we aren't seeing comparable performance for the same test case. What I'm testing on is couple-year-old desktop kit (dual 2.8GHz Xeon, consumer-grade disk drive) --- I had assumed your server would be at least as fast as that, but maybe not? regards, tom lane