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 1l6MEI-0001Qd-Sz for pgsql-general@arkaria.postgresql.org; Sun, 31 Jan 2021 23:34:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l6MEG-0002zB-Ia for pgsql-general@arkaria.postgresql.org; Sun, 31 Jan 2021 23:34:04 +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 1l6MEG-0002z4-B0 for pgsql-general@lists.postgresql.org; Sun, 31 Jan 2021 23:34:04 +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 1l6ME9-0006E7-DX for pgsql-general@lists.postgresql.org; Sun, 31 Jan 2021 23:34:03 +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 10VNXsiU3252501; Sun, 31 Jan 2021 18:33:54 -0500 From: Tom Lane To: Ben Hoskings cc: pgsql-general@lists.postgresql.org Subject: Re: Occasional lengthy locking causing stalling on commit In-reply-to: References: <2884110.1612025414@sss.pgh.pa.us> Comments: In-reply-to Ben Hoskings message dated "Mon, 01 Feb 2021 10:18:43 +1100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3252499.1612136034.1@sss.pgh.pa.us> Date: Sun, 31 Jan 2021 18:33:54 -0500 Message-ID: <3252500.1612136034@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ben Hoskings writes: > I wonder if there are any likely candidates that we could look into - > for example, is it possible it could be due a batched index update > that we could alleviate with "fastupdate=off"? No. This is late enough in the commit code path that we really don't want to be running anything that would take a long time or have a significant probability of failure. So I'm a bit mystified as to what it could be. Ockham's razor suggests that it's the notify processing itself, as you seem to be an outlier in how heavily you're using that; but that's no sure thing. One thing that just occurred to me is that you might find it interesting to keep tabs on what's in the $PGDATA/pg_notify directory. Do the performance burps correspond to transitory peaks in the amount of data there? Or (grasping at straws here...) wraparound of the file names back to 0000? regards, tom lane