public inbox for [email protected]
help / color / mirror / Atom feedFrom: KK CHN <[email protected]>
To: Alvaro Herrera <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: CLOSE_WAIT pileup and Application Timeout
Date: Mon, 7 Oct 2024 17:00:47 +0530
Message-ID: <CAKgGyB8zMUzJSMQL8ryc-73aG3YEhWj4hGkqtOBT_yywesyCHQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAKgGyB91QVCOFp+3vAcMDAauAPQ+TOVWrJxwcVAtYxaLxXaz4Q@mail.gmail.com>
<[email protected]>
On Mon, Oct 7, 2024 at 12:07 AM Alvaro Herrera <[email protected]>
wrote:
> On 2024-Oct-04, KK CHN wrote:
>
> > The mobile tablets are installed with the android based vehicle
> > tracking app which updated every 30 seconds its location fitted inside
> the
> > vehicle ( lat long coordinates) to the PostgreSQL DB through the java
> > backend application to know the latest location of the vehicle and its
> > movement which will be rendered in a map based front end.
> >
> > The vehicles on the field communicate via 443 to 8080 of the Wildfly
> > (version 27 ) deployed with the vehicle tracking application developed
> with
> > Java(version 17).
>
> It sounds like setting TCP keepalives in the connections between the
> Wildfly and the vehicles might help get the number of dead connections
> down to a reasonable level. Then it's up to Wildfly to close the
> connections to Postgres in a timely fashion. (It's not clear from your
> description how do vehicle connections to Wildfly relate to Postgres
> connections.)
>
>
Where do I have to introduce the TCP keepalives ? in the OS level or
application code level ?
[root@dbch wildfly-27.0.0.Final]# cat /proc/sys/net/ipv4/tcp_keepalive_time
7200
[root@dbch wildfly-27.0.0.Final]# cat /proc/sys/net/ipv4/tcp_keepalive_intvl
75
[root@dbch wildfly-27.0.0.Final]# cat
/proc/sys/net/ipv4/tcp_keepalive_probes
9
[root@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 ?
Any hints much appreciated..
>
> 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). Both the machines
internal lan VMs in the same network. Only the devices on the field
(fitted on the vehicles) communicate to the application backend via a
public URL :443 port then it connectes to the 8080 of wildfly then the
java code connects the database server running on 5432 on the internal LAN
network.
>
> --
> Álvaro Herrera 48°01'N 7°57'E —
> https://www.EnterpriseDB.com/
> Thou shalt study thy libraries and strive not to reinvent them without
> cause, that thy code may be short and readable and thy days pleasant
> and productive. (7th Commandment for C Programmers)
>
view thread (5+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: CLOSE_WAIT pileup and Application Timeout
In-Reply-To: <CAKgGyB8zMUzJSMQL8ryc-73aG3YEhWj4hGkqtOBT_yywesyCHQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox