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 1jPRi2-0001Or-VO for pgsql-general@arkaria.postgresql.org; Fri, 17 Apr 2020 14:11: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 1jPRi0-0001pl-GN for pgsql-general@arkaria.postgresql.org; Fri, 17 Apr 2020 14:11: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 1jPRi0-0001pJ-8N for pgsql-general@lists.postgresql.org; Fri, 17 Apr 2020 14:11:08 +0000 Received: from [66.111.4.26] (helo=out2-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jPRhw-0001Fx-Bc for pgsql-general@postgresql.org; Fri, 17 Apr 2020 14:11:07 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 598405C0132; Fri, 17 Apr 2020 10:10:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 17 Apr 2020 10:10:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=X BBsZo1jeSt5BOBcwImYhuC10Z/UDjTTclzF0OS+FVM=; b=CO0rUXX1qCuET2Sf+ /RD5P9h64OnGFF1YPb90JocvwG/kE5gs9ckQQhs4XW9qX0PjBEWPMRNkdyRf441C zZuc+xEoSD/xrzff5ulIh0xOHRkn/WY6Of8pGalfaHXoLKGCEADi3KBNisBhpcQL PazGCD28NQIPJOA+VEWE1JXxfnzLw5n3O7vdmZKS+U9ntzV0w4l9WUsYsa3RrzRJ Sw3/yNAG5AVHGj1Lu2a6ILiZ4C6l/yhQ70otlhATva0NsFmzhqiHxxouEnr5DW27 I93wIwTRvogE4daJy/uWweyazN8buyh2/NDD4nj0h1psEg0c3InI1AIbHrMm9qy2 ArOrg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=XBBsZo1jeSt5BOBcwImYhuC10Z/UDjTTclzF0OS+F VM=; b=JJ1/e/5Hvh7Q27FX4RLwz5zz3yPJpcBdsaqCzcH6oKmMC2rKNvLf/jYUW ReneQnpE33qrmSV00z2fvz6fieXO97FCwEGudCsXUT/33KzaqilDnCH3HovUQLSQ kJmK117qFNMBg+7v1qlI6ecmdMRTVnGSbxE4jDTioGZ++RxzBCH2QfcxZH2N6JTa lrcfZGuf34rAqenhXPz42VVXO+NQIGWcKRpJW5lHlMIWI/MorV628SaMNtSeCTvW N4A8Y3CV7tPlsefo46VYR1lOoNhAM8kZJGOawJerm9lLTSItvbouncBPvEW+kycL 2B2xy3RF/aKFhzpXob8ca3CAk0LNQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrfeejgdejgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthekre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucfkphepleejrdduudefrddvtdejrddufe eknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggu rhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.10] (97-113-207-138.tukw.qwest.net [97.113.207.138]) by mail.messagingengine.com (Postfix) with ESMTPA id 581443280069; Fri, 17 Apr 2020 10:10:52 -0400 (EDT) Subject: Re: Could not resolve host name error in psycopg2 To: =?UTF-8?Q?Paul_F=c3=b6rster?= Cc: derwin theduck , pgsql-general@postgresql.org References: From: Adrian Klaver Message-ID: <4e520e58-3a5c-eab2-3563-8f5f38ff7e26@aklaver.com> Date: Fri, 17 Apr 2020 07:10:51 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.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 X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.26 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 4/17/20 12:02 AM, Paul Förster wrote: > Hi Adrian, > >> On 17. Apr, 2020, at 03:00, Adrian Klaver wrote: >> >> Huh? Leaving open connections is not considered a good thing. In other words a connection should last for as long as it takes to get it's task done and then it should close. > > I basically agree on this, but there are two big "but"s: > > - recurring monitoring connections flood the logs unless they connect and never disconnect again. > > - applications with hundreds or thousands of users may flood the logs, even though a pool may be used. If said pool doesn't keep its connections open most of the time you will notice that the database cluster is very busy logging connections. But most pools can grow and shrink in response to demand, so at some point there are connect/disconnect cycles. > > Do you really want that? No. The issue at hand though was the idea that an application(Django in this case) would open a connection once and never reconnect. That is unrealistic. > > Cheers, > Paul > -- Adrian Klaver adrian.klaver@aklaver.com