Postgres tcp_keepalive_xxxx parameters.

Поиск
Список
Период
Сортировка
От jlrando
Тема Postgres tcp_keepalive_xxxx parameters.
Дата
Msg-id 1412175460068-5821282.post@n5.nabble.com
обсуждение исходный текст
Ответы Re: Postgres tcp_keepalive_xxxx parameters.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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.


В списке pgsql-general по дате отправления:

Предыдущее
От: Andy Colson
Дата:
Сообщение: Re: Best practices for Large import in empty database?
Следующее
От: Daniel Begin
Дата:
Сообщение: Re: Best practices for Large import in empty database?