PostgreSQL keepalives help

--_000_4A704C139DFD804DB74FFB9CC0BE79FC790B5631C3SBSsteploca l_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hy,

I have a system working with the client-server structure and PostgreSQL 8.4=
..
My problem is that if a client who is editing a record and lose his connect=
ion to the server,the TCPIP connection is still considered! So, the record =
stay allocated for the client in my database.
I need the records are free for edit, in few minutes. Therefore I set the K=
EEPALIVE configuration in my "postgresql.conf":

tcp_keepalives_idle =3D 60 # TCP_KEEPIDLE, in seconds;
tcp_keepalives_interval =3D 60 # TCP_KEEPINTVL, in seconds;
tcp_keepalives_count TCP_KEEPCNT =3D 5 #;

After making these settings and restart the server, the system continues to=
function the same way: Just breaks the connection TCPIP after two hours an=
d then deallocates the records in PostgreSQL. I need a efficient and safe w=
ay for the PostgreSQL understand that is to break these connections as conf=
igured! I need help, urgent!

Thanks,

Kananda S Silveira - Desenvolvedora .NET / Analista de Banco de Dados
STEP SOFTWARE Tecnologia e Projetos LTDA
kananda [at] stepsoftware.com.br<mailto:kananda [at] stepsoftware.com.br> / +55(48)84=
17-8121

--_000_4A704C139DFD804DB74FFB9CC0BE79FC790B5631C3SBSsteploca l_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html dir=3D"ltr"><head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style title=3D"owaParaStyle"><!--P {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body ocsi=3D"x">
<div dir=3D"ltr"><font size=3D"2" face=3D"tahoma">Hy, </font></div>
<div dir=3D"ltr"><font size=3D"2" face=3D"tahoma"></font> </div>
<div dir=3D"ltr"><font size=3D"2" face=3D"tahoma">I have a system working w=
ith the client-server structure and PostgreSQL 8.4.
<br>
My problem is that if a client who is editing a record and lose his connect=
ion to the server,the TCPIP connection is still considered! So, the record =
stay allocated for the client in my database.
<br>
I need the records are free for edit, in few minutes. Therefore I set the K=
EEPALIVE configuration in my "postgresql.conf":
</font></div>
<div dir=3D"ltr"><font size=3D"2" face=3D"tahoma"></font> </div>
<div dir=3D"ltr"><font size=3D"2" face=3D"tahoma">tcp_keepalives_idle =3D 6=
0 # TCP_KEEPIDLE, in seconds;
<br>
tcp_keepalives_interval =3D 60 # TCP_KEEPINTVL, in seconds; <br>
tcp_keepalives_count TCP_KEEPCNT =3D 5 #; </font></div>
<div dir=3D"ltr"><font size=3D"2" face=3D"tahoma"></font> </div>
<div dir=3D"ltr"><font size=3D"2" face=3D"tahoma">After making these settin=
gs and restart the server, the system continues to function the same way: J=
ust breaks the connection TCPIP after two hours and then deallocates the re=
cords in PostgreSQL. I need a efficient
and safe way for the PostgreSQL understand that is to break these connecti=
ons as configured! I need help, urgent!
</font></div>
<div dir=3D"ltr"><font size=3D"2" face=3D"tahoma"></font> </div>
<div dir=3D"ltr"><font size=3D"2" face=3D"tahoma">Thanks,</font></div>
<div dir=3D"ltr"><font size=3D"2" face=3D"tahoma"></font> </div>
<div class=3D"BodyFragment"><font size=3D"2">
<div class=3D"PlainText"><font face=3D"Trebuchet MS"><strong><font size=3D"=
3">Kananda S Silveira</font></strong> -
</font><font size=3D"3"><font face=3D"Trebuchet MS"><em>Desenvolvedora .NET=
/ Analista de Banco de Dados</em></font></font></div>
<div class=3D"PlainText"><font size=3D"3"><font face=3D"Trebuchet MS"><stro=
ng><font color=3D"#3366ff">STEP SOFTWARE Tecnologia e Projetos LTDA</font><=
/strong></font></font></div>
<div class=3D"PlainText"><font face=3D"Trebuchet MS"><a href=3D"mailto:kana=
nda [at] stepsoftware.com.br"><font color=3D"#808080" size=3D"2">kananda [at] stepsof=
tware.com.br</font></a><font color=3D"#808080" size=3D"2"> / +55(4=
8)8417-8121</font></font></div>
</font></div>
</body>
</html>

--_000_4A704C139DFD804DB74FFB9CC0BE79FC790B5631C3SBSsteploca l_--
Kananda [ Do, 29 Juli 2010 22:16 ] [ ID #2045284 ]

Re: [GENERAL] PostgreSQL keepalives help

!!! Please do not post to multiple lists. Pick one, see what bites
you get, wait, then try another if no one answers. I'm removing all
but pgsql-admin from this post !!!

On Thu, Jul 29, 2010 at 2:16 PM, Kananda <Kananda [at] stepsoftware.com.br> wrote:
> Hy,
>
> I have a system working with the client-server structure and PostgreSQL 8.4.

What OS?

> My problem is that if a client who is editing a record and lose his
> connection to the server,the TCPIP connection is still considered! So, the
> record stay allocated for the client in my database.
> I need the records are free for edit, in few minutes. Therefore I set the
> KEEPALIVE configuration in my "postgresql.conf":
>
> tcp_keepalives_idle = 60 # TCP_KEEPIDLE, in seconds;
> tcp_keepalives_interval = 60 # TCP_KEEPINTVL, in seconds;
> tcp_keepalives_count TCP_KEEPCNT = 5 #;
>
> After making these settings and restart the server, the system continues to
> function the same way: Just breaks the connection TCPIP after two hours and
> then deallocates the records in PostgreSQL. I need a efficient and safe way
> for the PostgreSQL understand that is to break these connections as
> configured! I need help, urgent!

I'll assume you're on linux, in which case try setting those values
with sysctl like so:

Edit /etc/sysctl.conf. add these lines at the bottom:

net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_probes = 2
net.ipv4.tcp_keepalive_intvl = 30

Then run "sudo sysctl -p"

See if the changes took effect:

sysctl -a|grep keepa

--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Scott Marlowe [ Fr, 30 Juli 2010 02:02 ] [ ID #2045315 ]

RES: [GENERAL] PostgreSQL keepalives help

No.. I'm not in linux! OS: Windows 7 (client) / Windows Server 2008 (server)

Thanks

Kananda S Silveira - Desenvolvedora .NET / Analista de Banco de Dados
STEP SOFTWARE Tecnologia e Projetos LTDA
kananda [at] stepsoftware.com.br / +55(48)8417-8121
________________________________________
De: Scott Marlowe [scott.marlowe [at] gmail.com]
Enviado: quinta-feira, 29 de julho de 2010 21:02
Para: Kananda
Cc: pgsql-admin [at] postgresql.org
Assunto: Re: [GENERAL] PostgreSQL keepalives help

!!! Please do not post to multiple lists. Pick one, see what bites
you get, wait, then try another if no one answers. I'm removing all
but pgsql-admin from this post !!!

On Thu, Jul 29, 2010 at 2:16 PM, Kananda <Kananda [at] stepsoftware.com.br> wrot=
e:
> Hy,
>
> I have a system working with the client-server structure and PostgreSQL 8=
..4.

What OS?

> My problem is that if a client who is editing a record and lose his
> connection to the server,the TCPIP connection is still considered! So, the
> record stay allocated for the client in my database.
> I need the records are free for edit, in few minutes. Therefore I set the
> KEEPALIVE configuration in my "postgresql.conf":
>
> tcp_keepalives_idle =3D 60 # TCP_KEEPIDLE, in seconds;
> tcp_keepalives_interval =3D 60 # TCP_KEEPINTVL, in seconds;
> tcp_keepalives_count TCP_KEEPCNT =3D 5 #;
>
> After making these settings and restart the server, the system continues =
to
> function the same way: Just breaks the connection TCPIP after two hours a=
nd
> then deallocates the records in PostgreSQL. I need a efficient and safe w=
ay
> for the PostgreSQL understand that is to break these connections as
> configured! I need help, urgent!

I'll assume you're on linux, in which case try setting those values
with sysctl like so:

Edit /etc/sysctl.conf. add these lines at the bottom:

net.ipv4.tcp_keepalive_time =3D 300
net.ipv4.tcp_keepalive_probes =3D 2
net.ipv4.tcp_keepalive_intvl =3D 30

Then run "sudo sysctl -p"

See if the changes took effect:

sysctl -a|grep keepa


--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Kananda [ Fr, 30 Juli 2010 13:58 ] [ ID #2045529 ]
Datenbanken » gmane.comp.db.postgresql.admin » PostgreSQL keepalives help

Vorheriges Thema: Autovacuum missing tables
Nächstes Thema: Autovacuum missing tables