Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rhSyw-00BbpZ-Qs for pgsql-general@arkaria.postgresql.org; Tue, 05 Mar 2024 11:29:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rhSyu-00G7L2-Gj for pgsql-general@arkaria.postgresql.org; Tue, 05 Mar 2024 11:29:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rhSyu-00G7Ks-6E for pgsql-general@lists.postgresql.org; Tue, 05 Mar 2024 11:29:12 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rhSyq-002xYF-A4 for pgsql-general@postgresql.org; Tue, 05 Mar 2024 11:29:11 +0000 Received: from [212.222.85.114] (helo=pureos) by ms-10.1blu.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rhSyo-007MWI-7L; Tue, 05 Mar 2024 12:29:06 +0100 Date: Tue, 5 Mar 2024 12:29:04 +0100 From: Matthias Apitz To: M Tarkeshwar Rao Cc: "pgsql-general@postgresql.org" , Piyush Anand , Neeraj Gupta G Subject: Re: Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy Message-ID: Reply-To: Matthias Apitz References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: FreeBSD 14.0-CURRENT 1400094 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 212.222.85.114 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk El día martes, marzo 05, 2024 a las 11:08:27 +0000, M Tarkeshwar Rao escribió: > Hi all, > > " > We are using libpq c client (Version : 14.10) of postgresql in our application to connect with postgresql database server (Version 14.10). > For making connection we are using libpq's API "PQsetdbLogin()". > > Problem Statement : If our connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy. > > Query : Is there any way we can provide values of "keepalives_idle, keepalives_interval, keepalives_count" client parameters in the API "PQsetdbLogin()" while creating the connection. > If yes, then can someone please provide the sample code for the same. > We need these parameters support at client side only. > " > > Is there any other alternative approach using some configuration files from client side? An option could be to run the connection through an SSH tunnel and use there the sshd(8) config parameter ClientAliveInterval. HIH matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub I am not at war with Russia. Я не воюю с Россией. Ich bin nicht im Krieg mit Russland.