Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v15sM-004UYV-O6 for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Sep 2025 16:28:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v15sL-006waW-6n for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Sep 2025 16:28:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v15sK-006wa6-Te for pgsql-hackers@lists.postgresql.org; Tue, 23 Sep 2025 16:28:20 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v15sI-001y8n-2h for pgsql-hackers@postgresql.org; Tue, 23 Sep 2025 16:28:20 +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 58NGRxng3095600; Tue, 23 Sep 2025 12:27:59 -0400 From: Tom Lane To: "Joel Jacobson" cc: "Thomas Munro" , pgsql-hackers , "Heikki Linnakangas" , "Rishu Bagga" Subject: Re: Optimize LISTEN/NOTIFY In-reply-to: References: <6899c044-4a82-49be-8117-e6f669765f7e@app.fastmail.com> <165530.1752362320@sss.pgh.pa.us> <02a7cd37-e2fc-4212-8b19-f8c239c95fb8@app.fastmail.com> <96f00bf1-cc9d-4520-9d02-9e14e7767c88@app.fastmail.com> <30c2aa7d-dd6c-4b68-a2e4-f217a1a34acf@app.fastmail.com> <0b4d402a-9ac2-4aa8-acf8-8231dbe579ea@app.fastmail.com> Comments: In-reply-to "Joel Jacobson" message dated "Thu, 07 Aug 2025 02:16:05 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3095598.1758644879.1@sss.pgh.pa.us> Date: Tue, 23 Sep 2025 12:27:59 -0400 Message-ID: <3095599.1758644879@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk [ getting back to this... ] "Joel Jacobson" writes: > I'm withdrawing the latest patches, since they won't fix the scalability > problems, but only provide some performance improvements by eliminating > redundant IPC signalling. This could also be improved outside of > async.c, by optimizing ProcSignal [1] or removing ProcSignal as > "Interrupts vs Signals" [2] is working on. > There seems to be two different scalability problems, that appears to be > orthogonal: > First, it's the thundering herd problems that I tried to solve initially > in this thread, by introducing a hash table in shared memory, to keep > track of what backends listen to what channels, to avoid immediate > wakeup of all listening backends for every notification. > Second, it's the heavyweight lock in PreCommit_Notify(), that prevents > parallelism of NOTIFY. Tom Lane has an idea [3] on how to improve this. I concur that these are orthogonal issues, but I don't understand why you withdrew your patches --- don't they constitute a solution to the first scalability bottleneck? > I guess my main question is if we think we should fix one problem first, > then the other, both at the same time, or only one or the other? I imagine we'd eventually want to fix both, but it doesn't have to be done in the same patch. regards, tom lane