Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e222i-0007Jt-80 for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Oct 2017 21:26:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e222h-00037U-Fj for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Oct 2017 21:26:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e221v-0001mI-K0 for pgsql-bugs@postgresql.org; Tue, 10 Oct 2017 21:25:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e221o-0005na-5E for pgsql-bugs@postgresql.org; Tue, 10 Oct 2017 21:25:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v9ALPOeS029603; Tue, 10 Oct 2017 17:25:24 -0400 From: Tom Lane To: Alvaro Herrera cc: Marko Tiikkaja , Michael Paquier , PostgreSQL mailing lists Subject: Re: BUG #14830: Missed NOTIFications, PostgreSQL 9.1.24 In-reply-to: <7833.1507658856@sss.pgh.pa.us> References: <20171010140621.u4avva4cxylwpyew@alvherre.pgsql> <16671.1507645188@sss.pgh.pa.us> <18082.1507647266@sss.pgh.pa.us> <7833.1507658856@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 10 Oct 2017 14:07:36 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29601.1507670724.1@sss.pgh.pa.us> Date: Tue, 10 Oct 2017 17:25:24 -0400 Message-ID: <29602.1507670724@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org I wrote: > Concretely, I suggest the attached patch. I tried Marko's testbed > against this, and it seems indeed a bit faster than before --- > running it for 100000 notifies takes about 19.25 seconds, rather than > 19.5 seconds with HEAD. But the testbed is probably about the best > case because it has a bunch of threads sending notifies to one > receiver, so that the receiver is quite likely to have multiple > messages to read at a time. OTOH, in a situation where the NOTIFY > traffic isn't so high, it probably hardly matters anyway. It occurred to me that it's easy to measure the worst case, ie always one message per notify interrupt: $ cat bnch.txt LISTEN foo\; NOTIFY foo; $ pgbench -n -c 1 -T 10 -f bnch.txt On this case it seems that the patch is circa 2% slower than HEAD, though that's only barely above the noise level in my measurements. I think that's probably acceptable. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs