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 1jK2tJ-0007z8-Np for pgsql-general@arkaria.postgresql.org; Thu, 02 Apr 2020 16:40:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jK2tI-0001cM-LT for pgsql-general@arkaria.postgresql.org; Thu, 02 Apr 2020 16:40:28 +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 1jK2tI-0001cE-DU for pgsql-general@lists.postgresql.org; Thu, 02 Apr 2020 16:40:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jK2tG-0004fV-7s for pgsql-general@postgresql.org; Thu, 02 Apr 2020 16:40:28 +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 032GeMuC020256; Thu, 2 Apr 2020 12:40:22 -0400 From: Tom Lane To: "Abraham, Danny" cc: "pgsql-general@postgresql.org" Subject: Re: too many clients already In-reply-to: <92f708a939754943bb4e75b47d1a10ba@phx-exmbprd-01.adprod.bmc.com> References: <17877.1585842715@sss.pgh.pa.us> <92f708a939754943bb4e75b47d1a10ba@phx-exmbprd-01.adprod.bmc.com> Comments: In-reply-to "Abraham, Danny" message dated "Thu, 02 Apr 2020 16:20:27 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20254.1585845622.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 02 Apr 2020 12:40:22 -0400 Message-ID: <20255.1585845622@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "Abraham, Danny" writes: > Well, I guess the questions is - how do I optimize PG for a stream of ve= ry short life checks... You should be using a connection pooler for a load like that. PG backends are fairly heavyweight things --- you don't want to fire one up for just a single query, at least not when there are many such queries per second. I think pgbouncer and pgpool are the most widely used options, but this is a bit outside my expertise. regards, tom lane