public inbox for [email protected]  
help / color / mirror / Atom feed
Re: CLOSE_WAIT pileup and Application Timeout
3+ messages / 2 participants
[nested] [flat]

* Re: CLOSE_WAIT pileup and Application Timeout
@ 2024-10-04 15:47  Adrian Klaver <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Adrian Klaver @ 2024-10-04 15:47 UTC (permalink / raw)
  To: KK CHN <[email protected]>; pgsql-general

On 10/3/24 21:29, KK CHN wrote:
> List,
> 
> I am facing a  network (TCP IP connection closing issue) .
> 
> Running a  mobile tablet application, Android application to update the 
> status of vehicles fleet say around 1000 numbers installed with the app 
> on each vehicle along  with a  vehicle tracking  application server 
> solution based on Java and Wildfly with  PosrgreSQL16 backend.
> 

> 
> The  running vehicles may disconnect  or be unable to send the location 
> data in between if the mobile data coverage is less or absent in a 
> particular area where data coverage is nil or signal strength less.
> 
> The server on which the backend application runs most often ( a week's 
> time  or so) shows connection timeout and is unable to serve tracking  
> of  the vehicles further.
> 
> When we restart the  Wildfly server  the application returns to normal.  
> again the issue repeats  after a week or two.

Seems the issue is in the application server. What is not clear to me is 
whether the connection timeout you refer to is from the mobile devices 
to the application or the application to the Postgres server? I'm 
guessing the latter as I would expect the mobile devices to drop 
connections more often then weekly.
> 
> In the Server machine when this bottleneck occurs  I am seeing  a lot 
> of  TCP/IP CLOSE_WAIT   ( 3000 to 5000 ) when the server backend becomes 
> unresponsive.

Again not clear, are you referring to the application or the Postgres 
database running on the server?

> 
> What is the root cause of this issue ?   Is it due to the android 
> application unable to send the CLOSE_WAIT ACK due to poor mobile data 
> connectivity ?
> 
> 
>   If so, how do people  address this issue ?  and what may be a fix ?
> 
>   Any  directions / or reference material most welcome.
> 
> Thank you,
> Krishane
> 
> 
> 
> 
> 

-- 
Adrian Klaver
[email protected]







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

* Re: CLOSE_WAIT pileup and Application Timeout
@ 2024-10-06 13:26  KK CHN <[email protected]>
  parent: Adrian Klaver <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: KK CHN @ 2024-10-06 13:26 UTC (permalink / raw)
  To: Adrian Klaver <[email protected]>; +Cc: pgsql-general

On Fri, Oct 4, 2024 at 9:17 PM Adrian Klaver <[email protected]>
wrote:

> On 10/3/24 21:29, KK CHN wrote:
> > List,
> >
> > I am facing a  network (TCP IP connection closing issue) .
> >
> > Running a  mobile tablet application, Android application to update the
> > status of vehicles fleet say around 1000 numbers installed with the app
> > on each vehicle along  with a  vehicle tracking  application server
> > solution based on Java and Wildfly with  PosrgreSQL16 backend.
> >
>
> >
> > The  running vehicles may disconnect  or be unable to send the location
> > data in between if the mobile data coverage is less or absent in a
> > particular area where data coverage is nil or signal strength less.
> >
> > The server on which the backend application runs most often ( a week's
> > time  or so) shows connection timeout and is unable to serve tracking
> > of  the vehicles further.
> >
> > When we restart the  Wildfly server  the application returns to normal.
> > again the issue repeats  after a week or two.
>
> Seems the issue is in the application server. What is not clear to me is
> whether the connection timeout you refer to is from the mobile devices
> to the application or the application to the Postgres server?

its from mobile devices to application server.  When I do a restart of
application server everything backs to normal.  But after a period of time
again it cripples.  That time when I netstat on Application VM lots of
CLOSE_WAIT states as indicated.


> I'm
> guessing the latter as I would expect the mobile devices to drop
> connections more often then weekly.



> Yes mobile devices may drops connections at any point of time if it
> reaches an area where signal strength is poor( eg; Underground parking or
> near the areas where mobile data coverage is poor.
> >


The topology is mobile devices  connect and update the location via
application VM then   finally in  PGSQL VM.

The application server and  Database server both separate virtual
machines.      Application server hangs most often not the database VM.
Since there are other applications which update to the database VM without
any issue.  The DB VM caters all the writes from other applications. But
those applications are different, not fleet management one.


>
> > In the Server machine when this bottleneck occurs  I am seeing  a lot
> > of  TCP/IP CLOSE_WAIT   ( 3000 to 5000 ) when the server backend becomes
> > unresponsive.
>
> Again not clear, are you referring to the application or the Postgres
> database running on the server?
>
> >
> > What is the root cause of this issue ?   Is it due to the android
> > application unable to send the CLOSE_WAIT ACK due to poor mobile data
> > connectivity ?
> >
> >
> >   If so, how do people  address this issue ?  and what may be a fix ?
> >
> >   Any  directions / or reference material most welcome.
> >
> > Thank you,
> > Krishane
> >
> >
> >
> >
> >
>
> --
> Adrian Klaver
> [email protected]
>
>


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

* Re: CLOSE_WAIT pileup and Application Timeout
@ 2024-10-06 15:52  Adrian Klaver <[email protected]>
  parent: KK CHN <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Adrian Klaver @ 2024-10-06 15:52 UTC (permalink / raw)
  To: KK CHN <[email protected]>; +Cc: pgsql-general

On 10/6/24 06:26, KK CHN wrote:
> 
> 
> On Fri, Oct 4, 2024 at 9:17 PM Adrian Klaver <[email protected] 

>     Seems the issue is in the application server. What is not clear to
>     me is
>     whether the connection timeout you refer to is from the mobile devices
>     to the application or the application to the Postgres server?
> 
> its from mobile devices to application server.  When I do a restart of 
> application server everything backs to normal.  But after a period of 
> time again it cripples.  That time when I netstat on Application VM lots 
> of  CLOSE_WAIT states as indicated.
> 
>     I'm
>     guessing the latter as I would expect the mobile devices to drop
>     connections more often then weekly. 
> 
>     Yes mobile devices may drops connections at any point of time if it
>     reaches an area where signal strength is poor( eg; Underground
>     parking or near the areas where mobile data coverage is poor.
>      >
> 
> 
> The topology is mobile devices  connect and update the location via 
> application VM then   finally in  PGSQL VM.
> 
> The application server and  Database server both separate virtual 
> machines.      Application server hangs most often not the database VM. 
> Since there are other applications which update to the database VM 
> without any issue.  The DB VM caters all the writes from other 
> applications. But those applications are different, not fleet management 
> one.

 From what I see this really has nothing to do with the Postgres 
backend. It is a matter of communication, actually lack of 
communication, between the mobile devices and the application server. A 
broad answer is that something needs to be done to gracefully deal with 
mobile device connection drops


-- 
Adrian Klaver
[email protected]







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


end of thread, other threads:[~2024-10-06 15:52 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-10-04 15:47 Re: CLOSE_WAIT pileup and Application Timeout Adrian Klaver <[email protected]>
2024-10-06 13:26 ` KK CHN <[email protected]>
2024-10-06 15:52   ` Adrian Klaver <[email protected]>

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