Thread: PostgreSQL keepalives help

PostgreSQL keepalives help

From
Kananda
Date:
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 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!
 
Thanks,
 
Kananda S Silveira - Desenvolvedora .NET / Analista de Banco de Dados
STEP SOFTWARE Tecnologia e Projetos LTDA
kananda@stepsoftware.com.br / +55(48)8417-8121

Re: PostgreSQL keepalives help

From
Richard Huxton
Date:
On 29/07/10 21:16, Kananda wrote:
> 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 #;

If this is actually what you have in your file, you have an error in
your count setting.

Try "show tcp_keepalives_count;" and so on - just check they're set as
you expect them to be. If they have the right values, put wireshark or
some other network monitor onto the connection and see if any packets
are being sent back and fore while there is no real traffic.

Oh, and please don't cross-post to multiple lists (particular
-cluster-hackers - can't see the relevance of that).

--
   Richard Huxton
   Archonet Ltd