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 1mtAXi-0008I7-3E for pgsql-general@arkaria.postgresql.org; Fri, 03 Dec 2021 15:32:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mtAXg-0006vX-5s for pgsql-general@arkaria.postgresql.org; Fri, 03 Dec 2021 15:32:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mtAXf-0006vO-R9 for pgsql-general@lists.postgresql.org; Fri, 03 Dec 2021 15:32:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mtAXd-0000QP-LB for pgsql-general@postgresql.org; Fri, 03 Dec 2021 15:32:06 +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 1B3FW3gN2293662; Fri, 3 Dec 2021 10:32:03 -0500 From: Tom Lane To: Dilip Kumar cc: James Sewell , pgsql-general Subject: Re: Max connections reached without max connections reached In-reply-to: References: <4176160.1637681607@sss.pgh.pa.us> <67613.1637709271@sss.pgh.pa.us> <81460.1637720668@sss.pgh.pa.us> Comments: In-reply-to Dilip Kumar message dated "Fri, 03 Dec 2021 14:31:23 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2293660.1638545523.1@sss.pgh.pa.us> Date: Fri, 03 Dec 2021 10:32:03 -0500 Message-ID: <2293661.1638545523@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dilip Kumar writes: > On Thu, Dec 2, 2021 at 9:35 AM Dilip Kumar wrote: >> I think there is no such view or anything which tells about which >> backend or transaction has more than 64 sub transaction. But if we >> are ready to modify the code then we can LOG that information in >> GetNewTransactionId(), when first time we are marking it overflown. > I have prepared a small patch to log this information. Putting an elog call into GetNewTransactionId seems like a completely horrid idea from a performance standpoint. Especially if you put it inside the XidGenLock hold, where it can block the entire system not just the one process. But even without that, this seems like a performance penalty with basically no real-world benefit. People who have issues like this are not going to want to trawl the postmaster log for such messages. regards, tom lane