Search Postgresql Archives

Postgres tcp_keepalive_xxxx parameters.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

We have an issue with postgres clients tha are being disconnected from
database server after some time. Client is a web application which creates a
pool of connections. Since client and server are on different VLANS I think
the problem is that the FW which is routing traffic is droping idle
connections after some time.

Os is CentOS 5.10 and kernel config is as follows:

root@itk-iv-mcs ~ # sysctl -a | grep keepalive
net.ipv4.tcp_keepalive_intvl = 75
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_time = 7200

tcp_keepalive_xxx in postgresql.conf were set to 0 all. Then we tried to set 

tcp_keepalives_idle = 60 # TCP_KEEPIDLE, in seconds;
tcp_keepalives_interval = 60 # TCP_KEEPINTVL, in seconds;
#tcp_keepalives_count = 0 # TCP_KEEPCNT;

So effective values (I guess are) 60,60 and 9 (system default). Even with
this configuration the cliens are being disconnected as before.

At this point I am not sure if I have understood properly the way keepalive
is working or not, becase if PG will send a packet after 60 seconds of
inactivity and the client respond ok then it will not retry and wait for
"tcp_keepalives_idle" seconds again... and so on. Then "interval" and
"count" are used only in case the client does not respond. If this is true
and I am not wrong then we can discard this issue as FW issue regarding idle
connections... Is this the behaviour of the tcp_keepalives_xxx parameters?

Is there any more I have to setup or check to make keepalive work?
Do you know how can we sort out this issue?

Thanks in advance.




--
View this message in context: http://postgresql.1045698.n5.nabble.com/Postgres-tcp-keepalive-xxxx-parameters-tp5821282.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux