From: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
---|---|
To: | KK CHN <kkchn(dot)in(at)gmail(dot)com> |
Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: CLOSE_WAIT pileup and Application Timeout |
Date: | 2024-10-07 14:31:38 |
Message-ID: | 202410071431.gxa5tcmlsojb@alvherre.pgsql |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 2024-Oct-07, KK CHN wrote:
> On Mon, Oct 7, 2024 at 12:07 AM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
> wrote:
> Where do I have to introduce the TCP keepalives ? in the OS level or
> application code level ?
>
> [root(at)dbch wildfly-27.0.0.Final]# cat /proc/sys/net/ipv4/tcp_keepalive_time
> 7200
> [root(at)dbch wildfly-27.0.0.Final]# cat /proc/sys/net/ipv4/tcp_keepalive_intvl
> 75
> [root(at)dbch wildfly-27.0.0.Final]# cat
> /proc/sys/net/ipv4/tcp_keepalive_probes
> 9
> [root(at)dbch wildfly-27.0.0.Final]#
>
> These are the default values in the OS level. Do I need to reduce all the
> above three values to say 600, 20, 5 ? Or need to be handled in the
> application backend code ?
My understanding is that these values have no effect unless the socket
gets
setsockopt( ... , SO_KEEPALIVE, ...)
So that's definitely something that the app needs to do -- it's not
enabled automatically.
With these default settings, the connection would be closed about 2:11
after going quiet, so if your problem manifests only a week later, you
would have enough time for these to be cleaned up. But of course you
should monitor what happens.
> > I wonder if the connections from Wildfly to Postgres use SSL? Because
> > there are reported cases where TCP connections are kept and accumulate,
> > causing problems -- but apparently SSL is a necessary piece for that to
> > happen.
> >
> No SSL in between Wildfly (8080 ) to PGSQL(5432).
Okay, that's unlikely to be relevant then.
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"Linux transformó mi computadora, de una `máquina para hacer cosas',
en un aparato realmente entretenido, sobre el cual cada día aprendo
algo nuevo" (Jaime Salinas)
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2024-10-07 15:10:50 | Re: libpq5 error |
Previous Message | Paul Brindusa | 2024-10-07 13:45:01 | libpq5 error |