Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8aeZ-0001lW-Ex for pgsql-general@arkaria.postgresql.org; Wed, 18 Apr 2018 00:08:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f8aeY-0000FP-0k for pgsql-general@arkaria.postgresql.org; Wed, 18 Apr 2018 00:08:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8aeX-0000FE-2A for pgsql-general@lists.postgresql.org; Wed, 18 Apr 2018 00:08:49 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f8aeS-0004SH-Tf for pgsql-general@lists.postgresql.org; Wed, 18 Apr 2018 00:08:48 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D184F21B92; Tue, 17 Apr 2018 20:08:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 17 Apr 2018 20:08:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=BOs9zoCMnLJbDBRYaJCoLudU1if0D h6a0wLUHjJe2io=; b=f3HgmOR2digrkpb9zjsfAv192OTu3M8UNtIJP3eWpB8+3 zMoS3AMbndxw/4tQEEAod3tOjjP3dBq/W0fPQ8BASy9f6O1kCwbNOTt0uF+rClT/ QJSHIROcFK+hCp86GPR51PPzMHrus+BdeUVAajUZF9gyESkbaK2NhNHJPZd01Pqq ItuV6Awfz9MShfnsTLoCPjcThD12J1hpRe+H9UKMMm5AKdTiQqH3V1o1eku4GCy9 AMS15Z+gSKXMmKKZbzsQd4yviXfYRuy3OH4+JE7/IRVPuaK/euV+tSgF5tExY5kN dC31X7Eya/mhvDw3xx5pE3NoWgVeVkc1Xcg/OTdAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=BOs9zo CMnLJbDBRYaJCoLudU1if0Dh6a0wLUHjJe2io=; b=JttMLfX2mYRiHpOn5o69XK TeBGQboOLBMdiVgo1cSs7oIG4Yw5LwtNJPrAGu2jA8xlCVR3yLuz38YuGag98xgZ vk+xwBZ/2QaNIPlW9wvDPnq7zhU8o43iDFVtMMSqokQZ6V7hS5bivPt/Zs8v+7/D t4CgAwPJABfCDMVCWSTMbCYC3eP1XgZIi5JJQezhc9fW0R1i9PNSLRPD6uPep1vY cV3kFZ4TXfOMt8TpDvIUhJKPIxE3FNotbihmW2VvG7vIRfzri0fJmHjKFRxDAwcR 6AjZS0tc4i9vpFa90l+f1WnphjdDyiv5MNUNruNsnXxeKlcSS+4Hl8ok0ES+Ma+w == X-ME-Sender: Received: from [192.168.1.2] (unknown [71.212.135.74]) by mail.messagingengine.com (Postfix) with ESMTPA id 14A31E50B7; Tue, 17 Apr 2018 20:08:41 -0400 (EDT) Subject: Re: Old active connections? To: Hans Sebastian , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: <9e5e6abd-e7d0-17fe-06d3-edea494fe7d0@aklaver.com> Date: Tue, 17 Apr 2018 17:08:41 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/17/2018 05:02 PM, Hans Sebastian wrote: > Hello group, > > We run postgresql 10.3 for a python django app with gunicorn on nginx > with django version 1.9.5. > > Recently, we started noticing there are many active connections from the > django app server that are more than 1 week old still showing in > pg_stat_activity. > > Even though the django server has been stopped (all processes killed), > the active connections still persist. All of these connections are > UPDATE queries that look pretty normal. Are sure they are coming from Django? > > Does anyone know the reasons they could be there? What could have caused > them being still active? Can we see the data from pg_stat_activity for those queries? > > This has become an issue as we started getting "FATAL:  remaining > connection slots are reserved for non-replication superuser connections" > > Thanks, > -hans > -- Adrian Klaver adrian.klaver@aklaver.com