Thread: connection dropping

connection dropping

From
bill
Date:
Hello,
I love pgAdmin III. I use it when working at home. I'm stuck with II at 
work since my machine is W98, although it (II)has a feature I prefer 
over III. Anyway, here on the homefront, I'm connected via high-speed 
cable connection (1.5 meg). I get excellent performance, however, I find 
that pgAdmin drops the DB connection rather quickly if there is no 
activity. If I leave the interface for any amount of time, when I come 
back and click on anything, I get the error message:
"An error has occurred:

server closed the connection unexpectedly   This probably means the server terminated abnormally before of while 
processing the request."

After this I usually have to click through many dialog boxes telling me 
that there is no connection to the server.

If I look at the process list in the DB server, I can see all the 
connections I have made over a period just sitting there 'idle'.
There is nothing in the log that corresponds with the drop that I can 
tell except with the possibility of:
LOG:  pq_recvbuf: recv() failed: Connection reset by peer
,but these may be from other clients.

What can I do to maintain the connection even if its idle?
Thanks,
Bill



Re: connection dropping

From
fmonkey@fmonkey.net
Date:
> Hello,
> I love pgAdmin III. I use it when working at home. I'm stuck with II at
> work since my machine is W98, although it (II)has a feature I prefer
> over III. Anyway, here on the homefront, I'm connected via high-speed
> cable connection (1.5 meg). I get excellent performance, however, I find
> that pgAdmin drops the DB connection rather quickly if there is no
> activity. If I leave the interface for any amount of time, when I come
> back and click on anything, I get the error message:
> "An error has occurred:
>
> server closed the connection unexpectedly
>     This probably means the server terminated abnormally before of while
> processing the request."
>
> After this I usually have to click through many dialog boxes telling me
> that there is no connection to the server.
>
> If I look at the process list in the DB server, I can see all the
> connections I have made over a period just sitting there 'idle'.
> There is nothing in the log that corresponds with the drop that I can
> tell except with the possibility of:
> LOG:  pq_recvbuf: recv() failed: Connection reset by peer
> ,but these may be from other clients.
>
> What can I do to maintain the connection even if its idle?
>

I don't know how much help I can be, but I'll see if I can give you some
suggestions, or things to look at, to at least isolate the problem.

Do you experience this with other applications?  I.e., if you open a ssh
connection to a server, and leave it sitting for a while, does the session
close/timeout?

The odds are good that the problem here is that a router or firewall (most
likely a firewall) between you and the database server is killing your
connection, but not telling the server about it.  This happens quite a bit
to me behind NAT'ing firewalls.  OTOH, behind my NAT'ing linksys cable
router at home, my connections never time out, even if I leave them up for
days.

We've had the discussion before about adding support to pgAdmin3 for
trying to keep connections alive through bad firewalls, but we've come to
the conclusion that there isn't a "good" way to do this in the
application, and that these sort of network problems are better solved by
the end-user, not the application, since they are likely to affect lots of
applications, not just pgAdmin3.

If you can provide me some further information about your network setup,
maybe I can give you some suggestions for trying to fix it that way.

ahp


Re: connection dropping

From
"James M Doherty PGADMIN"
Date:
If you are working from a windows machine and using putty there is a
time-out setting which you can enable.
This basically sends a null byte every (seconds you specify) to the far end.
Most firewall allow a tcp connection
but if data is not transmitted withing (firewall timeout) your connection
will be dropped by the firewall, this is
usually around 120 seconds.

Jim
----- Original Message ----- 
From: <fmonkey@fmonkey.net>
To: "bill" <billmac333@comcast.net>
Cc: <pgadmin-support@postgresql.org>
Sent: Thursday, October 16, 2003 11:31 AM
Subject: Re: [pgadmin-support] connection dropping


> > Hello,
> > I love pgAdmin III. I use it when working at home. I'm stuck with II at
> > work since my machine is W98, although it (II)has a feature I prefer
> > over III. Anyway, here on the homefront, I'm connected via high-speed
> > cable connection (1.5 meg). I get excellent performance, however, I find
> > that pgAdmin drops the DB connection rather quickly if there is no
> > activity. If I leave the interface for any amount of time, when I come
> > back and click on anything, I get the error message:
> > "An error has occurred:
> >
> > server closed the connection unexpectedly
> >     This probably means the server terminated abnormally before of while
> > processing the request."
> >
> > After this I usually have to click through many dialog boxes telling me
> > that there is no connection to the server.
> >
> > If I look at the process list in the DB server, I can see all the
> > connections I have made over a period just sitting there 'idle'.
> > There is nothing in the log that corresponds with the drop that I can
> > tell except with the possibility of:
> > LOG:  pq_recvbuf: recv() failed: Connection reset by peer
> > ,but these may be from other clients.
> >
> > What can I do to maintain the connection even if its idle?
> >
>
> I don't know how much help I can be, but I'll see if I can give you some
> suggestions, or things to look at, to at least isolate the problem.
>
> Do you experience this with other applications?  I.e., if you open a ssh
> connection to a server, and leave it sitting for a while, does the session
> close/timeout?
>
> The odds are good that the problem here is that a router or firewall (most
> likely a firewall) between you and the database server is killing your
> connection, but not telling the server about it.  This happens quite a bit
> to me behind NAT'ing firewalls.  OTOH, behind my NAT'ing linksys cable
> router at home, my connections never time out, even if I leave them up for
> days.
>
> We've had the discussion before about adding support to pgAdmin3 for
> trying to keep connections alive through bad firewalls, but we've come to
> the conclusion that there isn't a "good" way to do this in the
> application, and that these sort of network problems are better solved by
> the end-user, not the application, since they are likely to affect lots of
> applications, not just pgAdmin3.
>
> If you can provide me some further information about your network setup,
> maybe I can give you some suggestions for trying to fix it that way.
>
> ahp
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
>



Re: connection dropping

From
"James M Doherty PGADMIN"
Date:
Also,

if you use an SSH tunnel you can get around the timeout issue...

Jim
----- Original Message ----- 
From: <fmonkey@fmonkey.net>
To: "bill" <billmac333@comcast.net>
Cc: <pgadmin-support@postgresql.org>
Sent: Thursday, October 16, 2003 11:31 AM
Subject: Re: [pgadmin-support] connection dropping


> > Hello,
> > I love pgAdmin III. I use it when working at home. I'm stuck with II at
> > work since my machine is W98, although it (II)has a feature I prefer
> > over III. Anyway, here on the homefront, I'm connected via high-speed
> > cable connection (1.5 meg). I get excellent performance, however, I find
> > that pgAdmin drops the DB connection rather quickly if there is no
> > activity. If I leave the interface for any amount of time, when I come
> > back and click on anything, I get the error message:
> > "An error has occurred:
> >
> > server closed the connection unexpectedly
> >     This probably means the server terminated abnormally before of while
> > processing the request."
> >
> > After this I usually have to click through many dialog boxes telling me
> > that there is no connection to the server.
> >
> > If I look at the process list in the DB server, I can see all the
> > connections I have made over a period just sitting there 'idle'.
> > There is nothing in the log that corresponds with the drop that I can
> > tell except with the possibility of:
> > LOG:  pq_recvbuf: recv() failed: Connection reset by peer
> > ,but these may be from other clients.
> >
> > What can I do to maintain the connection even if its idle?
> >
>
> I don't know how much help I can be, but I'll see if I can give you some
> suggestions, or things to look at, to at least isolate the problem.
>
> Do you experience this with other applications?  I.e., if you open a ssh
> connection to a server, and leave it sitting for a while, does the session
> close/timeout?
>
> The odds are good that the problem here is that a router or firewall (most
> likely a firewall) between you and the database server is killing your
> connection, but not telling the server about it.  This happens quite a bit
> to me behind NAT'ing firewalls.  OTOH, behind my NAT'ing linksys cable
> router at home, my connections never time out, even if I leave them up for
> days.
>
> We've had the discussion before about adding support to pgAdmin3 for
> trying to keep connections alive through bad firewalls, but we've come to
> the conclusion that there isn't a "good" way to do this in the
> application, and that these sort of network problems are better solved by
> the end-user, not the application, since they are likely to affect lots of
> applications, not just pgAdmin3.
>
> If you can provide me some further information about your network setup,
> maybe I can give you some suggestions for trying to fix it that way.
>
> ahp
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
>



Re: connection dropping

From
bill
Date:
Thanks for the offer.
I am NAT'd behind a D-Link router connected to the cable modem. I am on 
the Comcast network.
I have noticed occasionally that my SSH connections will die off even 
though I have putty set to do 60 second keep-alives (I'm assuming that 
it really is). It usually isn't a problem though. If they go down, it is 
usually after quite an idle period.
Perhaps SSH connections are more tolerant of burps in connectivity than 
pgSQL connections?

fmonkey@fmonkey.net wrote:

>>Hello,
>>I love pgAdmin III. I use it when working at home. I'm stuck with II at
>>work since my machine is W98, although it (II)has a feature I prefer
>>over III. Anyway, here on the homefront, I'm connected via high-speed
>>cable connection (1.5 meg). I get excellent performance, however, I find
>>that pgAdmin drops the DB connection rather quickly if there is no
>>activity. If I leave the interface for any amount of time, when I come
>>back and click on anything, I get the error message:
>>"An error has occurred:
>>
>>server closed the connection unexpectedly
>>    This probably means the server terminated abnormally before of while
>>processing the request."
>>
>>After this I usually have to click through many dialog boxes telling me
>>that there is no connection to the server.
>>
>>If I look at the process list in the DB server, I can see all the
>>connections I have made over a period just sitting there 'idle'.
>>There is nothing in the log that corresponds with the drop that I can
>>tell except with the possibility of:
>>LOG:  pq_recvbuf: recv() failed: Connection reset by peer
>>,but these may be from other clients.
>>
>>What can I do to maintain the connection even if its idle?
>>
>>    
>>
>
>I don't know how much help I can be, but I'll see if I can give you some
>suggestions, or things to look at, to at least isolate the problem.
>
>Do you experience this with other applications?  I.e., if you open a ssh
>connection to a server, and leave it sitting for a while, does the session
>close/timeout?
>
>The odds are good that the problem here is that a router or firewall (most
>likely a firewall) between you and the database server is killing your
>connection, but not telling the server about it.  This happens quite a bit
>to me behind NAT'ing firewalls.  OTOH, behind my NAT'ing linksys cable
>router at home, my connections never time out, even if I leave them up for
>days.
>
>We've had the discussion before about adding support to pgAdmin3 for
>trying to keep connections alive through bad firewalls, but we've come to
>the conclusion that there isn't a "good" way to do this in the
>application, and that these sort of network problems are better solved by
>the end-user, not the application, since they are likely to affect lots of
>applications, not just pgAdmin3.
>
>If you can provide me some further information about your network setup,
>maybe I can give you some suggestions for trying to fix it that way.
>
>ahp
>
>  
>



Re: connection dropping

From
Andrae Muys
Date:
bill wrote:

> Thanks for the offer.
> I am NAT'd behind a D-Link router connected to the cable modem. I am on 
> the Comcast network.
> I have noticed occasionally that my SSH connections will die off even 
> though I have putty set to do 60 second keep-alives (I'm assuming that 
> it really is). It usually isn't a problem though. If they go down, it is 
> usually after quite an idle period.
> Perhaps SSH connections are more tolerant of burps in connectivity than 
> pgSQL connections?
> 

Than as a work around have you considered setting up a ppp link over 
your SSH connection and running the pgSQL connection over that?  As an 
added bonus, you get a `secure' db connection into the bargin.

Andrae