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 1mtBRw-0002nG-7C for pgsql-general@arkaria.postgresql.org; Fri, 03 Dec 2021 16:30:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mtBRu-0008Fv-RT for pgsql-general@arkaria.postgresql.org; Fri, 03 Dec 2021 16:30:14 +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 <9erthalion6@gmail.com>) id 1mtBRu-0008Fc-Ea for pgsql-general@lists.postgresql.org; Fri, 03 Dec 2021 16:30:14 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1mtBRs-0002lQ-2y for pgsql-general@postgresql.org; Fri, 03 Dec 2021 16:30:14 +0000 Received: by mail-wm1-x32b.google.com with SMTP id j140-20020a1c2392000000b003399ae48f58so5296943wmj.5 for ; Fri, 03 Dec 2021 08:30:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=490y5f15KNoNqO2gO+6kuwjjNSFQea6n+QIwnBDrvHs=; b=OQunfMK9S2LWvYs5/ySnh/AZM5YlWNlhfFx2LBG0XJqT3BUzzSxJsM2NKG6GZJcZx0 m5am5bDY1/b8RukaORtPEJ5sIYnayJhBtTnB+3KXv5GVdBJsSbsTU4CWRQj5O0qbqDrS rYEopVt6FcBPqKRffTkLbM9OzqijIunVosmvCl8RYYBLyVKN+fCFYGOO3AN6/CsDx+KZ +17TsCHsrLqhfqEQqnlq0vUtKhyyH0/POoHbuyhX67izlKL3a6LJ0LEbblo7lP5HFLPx GLmbWkWDt2mKUNpyiL3xQN7NF2G4uJmeFCFke3LfG6d3hKKOsGRcJUP7uz1BzRkgVcV+ OEsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=490y5f15KNoNqO2gO+6kuwjjNSFQea6n+QIwnBDrvHs=; b=1ST1EvJmhMUz5xO0qCcsPUeeEiCG4XE/jr86WyvXClfrESVozE/FCWRU3HKyn95Pk3 l1jwmi4iD8zeU5bk6emK03UzG4NgzyysRBeNYtIMOEd2idngFty6kC882urxHtQmHoan 0i7eQsZWsMwDHcSoZCwIs5nW0A3KXdaMWjbntsCAuCldzgYc/ecRvOgZcmMYum4o1/R+ C8aOF9XxfLT2j/6I72OaWiu6cgps0e8J4CPaUmmPObw+sllPwXCYtmCzqxTjRdmCz1uW 9fjbEm9gkrgQoaknZxcfKqtZoQtf9zJYLHpRP+BU/j2ylhgvrTRRdGoz1lyO+jZAo9YX WoVA== X-Gm-Message-State: AOAM5326nEXl8Qi13G8NwI3KWOdEcn5dlSHFyoxr0ivi0Ycnm6m2ches L5OTCi18+1Z6dSMIIftDULsdzMb1wkk= X-Google-Smtp-Source: ABdhPJxcmXg/LvbYj5FJkbOdTkm4mYp0qHwty4vuwnXyN3nOCZWSuanWDy2FdzeqJ2oswQvgABUZRQ== X-Received: by 2002:a1c:1c1:: with SMTP id 184mr16242204wmb.1.1638549011407; Fri, 03 Dec 2021 08:30:11 -0800 (PST) Received: from localhost (dslb-178-012-041-031.178.012.pools.vodafone-ip.de. [178.12.41.31]) by smtp.gmail.com with ESMTPSA id y7sm3011100wrw.55.2021.12.03.08.30.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Dec 2021 08:30:11 -0800 (PST) Date: Fri, 3 Dec 2021 17:31:08 +0100 From: Dmitry Dolgov <9erthalion6@gmail.com> To: Tom Lane Cc: Dilip Kumar , James Sewell , pgsql-general Subject: Re: Max connections reached without max connections reached Message-ID: <20211203163108.bfn4td7ruruh3bvp@localhost> References: <2293661.1638545523@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2293661.1638545523@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Fri, Dec 03, 2021 at 10:32:03AM -0500, Tom Lane wrote: > 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. Maybe it's worth a trace point then, to allow collect such info sort of on demand?