pg.ddx.io pgsql-admin@postgresql.org mailing list archivehelp / color / mirror / Atom feed
PostgreSQL keepalives help 3+ messages / 3 participants [nested] [flat]
* PostgreSQL keepalives help @ 2010-07-29 20:16 Kananda <Kananda@stepsoftware.com.br> 0 siblings, 2 replies; 3+ messages in thread From: Kananda @ 2010-07-29 20:16 UTC (permalink / raw) To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>; pgsql-admin; pgsql-cluster-hackers@postgresql.org <pgsql-cluster-hackers@postgresql.org> 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<mailto:kananda@stepsoftware.com.br> / +55(48)8417-8121 ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [GENERAL] PostgreSQL keepalives help @ 2010-07-30 00:02 Scott Marlowe <scott.marlowe@gmail.com> parent: Kananda <Kananda@stepsoftware.com.br> 1 sibling, 0 replies; 3+ messages in thread From: Scott Marlowe @ 2010-07-30 00:02 UTC (permalink / raw) To: Kananda <Kananda@stepsoftware.com.br>; +Cc: pgsql-admin !!! 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@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 ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: PostgreSQL keepalives help @ 2010-07-30 13:51 Richard Huxton <dev@archonet.com> parent: Kananda <Kananda@stepsoftware.com.br> 1 sibling, 0 replies; 3+ messages in thread From: Richard Huxton @ 2010-07-30 13:51 UTC (permalink / raw) To: Kananda <Kananda@stepsoftware.com.br>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org> 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 ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2010-07-30 13:51 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2010-07-29 20:16 PostgreSQL keepalives help Kananda <Kananda@stepsoftware.com.br> 2010-07-30 00:02 ` Scott Marlowe <scott.marlowe@gmail.com> 2010-07-30 13:51 ` Richard Huxton <dev@archonet.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox