pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy
5+ messages / 3 participants
[nested] [flat]

* Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy
@ 2024-03-05 11:07 M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
  2024-03-05 11:08 ` Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
  0 siblings, 1 reply; 5+ messages in thread

From: M Tarkeshwar Rao @ 2024-03-05 11:07 UTC (permalink / raw)
  To: pgsql-general; +Cc: Piyush Anand <piyush.anand@ericsson.com>; Neeraj Gupta G <neeraj.g.gupta@ericsson.com>

Hi Tarkesh,

"
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?

Thanks,
Tarkeshwar

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy
  2024-03-05 11:07 Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
@ 2024-03-05 11:08 ` M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
  2024-03-05 11:29   ` Re: Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy Matthias Apitz <guru@unixarea.de>
  0 siblings, 1 reply; 5+ messages in thread

From: M Tarkeshwar Rao @ 2024-03-05 11:08 UTC (permalink / raw)
  To: pgsql-general; +Cc: Piyush Anand <piyush.anand@ericsson.com>; Neeraj Gupta G <neeraj.g.gupta@ericsson.com>

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?

Thanks,
Tarkeshwar

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy
  2024-03-05 11:07 Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
  2024-03-05 11:08 ` Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
@ 2024-03-05 11:29   ` Matthias Apitz <guru@unixarea.de>
  2024-03-05 11:37     ` RE: Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Matthias Apitz @ 2024-03-05 11:29 UTC (permalink / raw)
  To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>; +Cc: pgsql-general; Piyush Anand <piyush.anand@ericsson.com>; Neeraj Gupta G <neeraj.g.gupta@ericsson.com>

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.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* RE: Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy
  2024-03-05 11:07 Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
  2024-03-05 11:08 ` Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
  2024-03-05 11:29   ` Re: Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy Matthias Apitz <guru@unixarea.de>
@ 2024-03-05 11:37     ` M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
  2024-03-05 11:54       ` Re: Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 5+ messages in thread

From: M Tarkeshwar Rao @ 2024-03-05 11:37 UTC (permalink / raw)
  To: Matthias Apitz <guru@unixarea.de>; +Cc: pgsql-general; Piyush Anand <piyush.anand@ericsson.com>; Neeraj Gupta G <neeraj.g.gupta@ericsson.com>

Hi Matthias,

Currently many customers are using this. 
We want to use libpq library APIs only. Is there any support of keepalive at client side?

Regards
Tarkeshwar

-----Original Message-----
From: Matthias Apitz <guru@unixarea.de> 
Sent: Tuesday, March 5, 2024 4:59 PM
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
Cc: pgsql-general@postgresql.org; Piyush Anand <piyush.anand@ericsson.com>; Neeraj Gupta G <neeraj.g.gupta@ericsson.com>
Subject: Re: Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy

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, https://protect2.fireeye.com/v1/url?k=31323334-501d5122-313273af-454445555731-8bc62051d01460c7&q... +49-176-38902045 Public GnuPG key: https://protect2.fireeye.com/v1/url?k=31323334-501d5122-313273af-454445555731-a831eed841ce4cbb&q...

I am not at war with Russia.  Я не воюю с Россией.
Ich bin nicht im Krieg mit Russland.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy
  2024-03-05 11:07 Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
  2024-03-05 11:08 ` Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
  2024-03-05 11:29   ` Re: Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy Matthias Apitz <guru@unixarea.de>
  2024-03-05 11:37     ` RE: Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
@ 2024-03-05 11:54       ` Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 5+ messages in thread

From: Laurenz Albe @ 2024-03-05 11:54 UTC (permalink / raw)
  To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>; Matthias Apitz <guru@unixarea.de>; +Cc: pgsql-general; Piyush Anand <piyush.anand@ericsson.com>; Neeraj Gupta G <neeraj.g.gupta@ericsson.com>

On Tue, 2024-03-05 at 11:37 +0000, M Tarkeshwar Rao wrote:
> We want to use libpq library APIs only. Is there any support of keepalive at client side?

Yes, there is.

Just add "keepalives_idle=60" to the connection string.  See
https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-KEEPALIVES-IDLE

Yours,
Laurenz Albe





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2024-03-05 11:54 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-03-05 11:07 Connection remains idle for more than 15 minutes, then the connection drops by IPVS setting in k8s kube-proxy M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2024-03-05 11:08 ` M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2024-03-05 11:29   ` Matthias Apitz <guru@unixarea.de>
2024-03-05 11:37     ` M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2024-03-05 11:54       ` Laurenz Albe <laurenz.albe@cybertec.at>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox