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 1kk5rt-0005Di-Tj for pgsql-admin@arkaria.postgresql.org; Tue, 01 Dec 2020 13:38:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kk5rr-0003yv-Gy for pgsql-admin@arkaria.postgresql.org; Tue, 01 Dec 2020 13:38:55 +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 1kk5rr-0003yo-6h for pgsql-admin@lists.postgresql.org; Tue, 01 Dec 2020 13:38:55 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kk5rk-0006VY-FA for pgsql-admin@postgresql.org; Tue, 01 Dec 2020 13:38:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JalhzRygsuFUlembPQEyrGp5J307SnRMq5cFoQAuKjU=; b=fc2pPrxNADgcvfjzwW1L0WnJ6g GUlT0TRUYuDOoS50w7jcMKEoK+DvWF+rspF5XwWAEKS3nHzlFE0/sNchwft9xrRtBH/CybQzqoMV8 VluH2QegQc3KNNIS/0OtmjbgzaNJ4WDd0ipgDxSlta9hZmCdfY9U6EyXbsBDuzmW0gCg=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1kk5rh-00006T-C8; Tue, 01 Dec 2020 14:38:45 +0100 Date: Tue, 1 Dec 2020 14:38:45 +0100 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Walters Che Ndoh Cc: pgsql-admin@postgresql.org Subject: Re: killing idle_connections Message-ID: <20201201133845.GC22431@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Nov 30, 2020 at 07:49:39PM -0700, Walters Che Ndoh wrote: > I have two DB's in prod > - DB 1 has pg12 and pgbouncer for connection pooling > - DB 2 has pg10 and F5 for connection pooling > > Both DB's have a max connection of 500. > During pick hours i always run out of connections, even though i have 3 > superuser reserved, my connections still go beyond 500. What is your pool_mode in pgbouncer? If it's "session" - then it is the problem, and you should consider reading https://www.depesz.com/2012/12/02/what-is-the-point-of-bouncing/ Please note that not all applications will work OK with transaction pooling, but if they don't then (for me) it's a sign that they should get fixed. depesz