Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1Onv-0006Iq-10 for pgsql-general@arkaria.postgresql.org; Wed, 06 Mar 2019 05:09:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1Ons-0006ne-Hw for pgsql-general@arkaria.postgresql.org; Wed, 06 Mar 2019 05:09:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1Ons-0006nX-6G for pgsql-general@lists.postgresql.org; Wed, 06 Mar 2019 05:09:16 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1Onp-0008J5-OT for pgsql-general@lists.postgresql.org; Wed, 06 Mar 2019 05:09:15 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0981D2201A; Wed, 6 Mar 2019 00:09:13 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 06 Mar 2019 00:09:13 -0500 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=Y Qh+44LE/P5FzGToHYhgaGpR1vkIcgixoYmcWPHAL9w=; b=uGBgZm6p1KNNwjeuy CRs5lbh2KTrFHnq5zgQYDe5qxk7uOB+L2uGGay1jdWivihpXTLEyx4XU6g6rHNbv l5xMMxHlAmGPwzukcb2tzavWOVQM0kkYDP2b6MtCcBHOWzfP4qwkuLRUtR7saWn6 cGlm/8KKDxhE8BC6RXhWRyxcjq4j3RLl2NvqZQOVC1Ew7q85mLokWglWBjZ4riUE BAkEK72Zq9m0W+tabfP7B9AEUg85vrM1J/sTdTWJlUWpfwZ8wyVAt2ik++bLKnO1 CzktwRzvU08UcZBqHmCZv1x52JLzdthzzmOeaBi8SXYCu0X6VoZpXKwQj5DoEG96 vUVsA== 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=YQh+44LE/P5FzGToHYhgaGpR1vkIcgixoYmcWPHAL 9w=; b=dWzFiyhbjnpsAN+9GU6NylizMfX+agJcvuCz8ZcV6zri3N7GG9iujUGjB LixiN0QDuX4ekdYcJaBVK9XZevnm5+ilH00Xj5VLuVXV4AlzbvD4ACIF7JlISXqX T8nFLt1Y/2z/cfG1V/VMvPbw5QvkfylB4gnTKNW/glcUTp5D/2MiB2oTNoxcRiTv eakfyzLcBAwBzK567pUrt2ASuTZmatH0wjdgwDVFYk/9Lq+tkvxlDvdb+6Ty38HS YhGsfRYov2EXYeAjEdfmaYU2iWQk2Hh1Jr7VnojqU4Yz5WnnmrwenuS4ppqd9+g0 7ila/ovaiiadtjgUcWj97lU4+T01Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrfeeggdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecukfhppeejuddrvdduvddrudehtddrvddtvdenucfrrghrrghmpehmrghilhhfrhho mheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvg hrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id F39BFE4210; Wed, 6 Mar 2019 00:09:11 -0500 (EST) Subject: Re: Connection Drop from PostgreSQL Database Server To: Mohit Kumar Sahni , "pgsql-general@lists.postgresql.org" Cc: Maneesh Kumar Singh References: <4fe719b0-1566-76c4-36c3-3f6548e31f5e@aklaver.com> From: Adrian Klaver Message-ID: Date: Tue, 5 Mar 2019 21:09:11 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/5/19 7:13 PM, Mohit Kumar Sahni wrote: > Hi Adrian, > > I have checked my log files. Here are some of the lines that I think were logged at the time of connection drop: > 2019-03-03 15:57:33.444 UTC [7146] azpostgres@master_configuration_db LOG: could not receive data from client: Connection timed out > 2019-03-03 15:57:33.444 UTC [13161] azpostgres@master_configuration_db LOG: could not receive data from client: Connection timed out > 2019-03-03 15:57:33.444 UTC [7571] azpostgres@master_configuration_db LOG: could not receive data from client: Connection timed out > 2019-03-03 15:57:33.446 UTC [14459] azpostgres@master_configuration_db LOG: could not receive data from client: Connection timed out > 2019-03-03 15:57:33.448 UTC [18010] azpostgres@postgres LOG: could not receive data from client: Connection timed out Where is the client running relative to the server? Does Azure Cloud have a timeout set for connections? > > And for the parameters, I have tried following values: > 1. tcp_keepalive_idle: 10000 & 2700 > 2. tcp_keepalive_interval: 10000 & 2600 > 3. tcp_keepalive_count: 0 & 1 > 4. session_timeout: 20000 > > All the values couldn't solve the problem. > > Thanks > Mohit Kumar Sahni > > ________________________________________ > From: Adrian Klaver > Sent: Wednesday, March 6, 2019 6:19 AM > To: Mohit Kumar Sahni; pgsql-general@lists.postgresql.org > Cc: Maneesh Kumar Singh > Subject: Re: Connection Drop from PostgreSQL Database Server > > On 3/5/19 4:19 AM, Mohit Kumar Sahni wrote: >> I have done a setup over Azure Cloud for my PostgreSQL DB. >> It's Ubuntu 18.04 LTS (4vCPU, 8GB RAM) machine with PostgreSQL 9.6 version. >> The problem that occurring is, when the connection to the postgresql db stays idle for some time let's say 2 to 10 minutes then the connection to the db does not respond such that it doesn't fulfil the request and keep processing the query. >> Same goes with my JAVA Springboot Application. The connection doesn't respond and the query keep processing. > > Is there anything in the Postgres log that is relevant? > > The same for the OS system log? > >> >> This happens randomly such that the timing is not traceable sometimes it happens in 2 minutes, sometimes in 10 minutes & sometimes don't. >> I have tried with PostgreSQL Configuration file parameters. I have tried: >> tcp_keepalive_idle, tcp_keepalive_interval, tcp_keepalive_count. >> Also statement_timeout & session_timeout parameters but it doesn't change anyway. > > What values for the above? > >> >> Thank you >> > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > -- Adrian Klaver adrian.klaver@aklaver.com