Re: How to close dead connections immediately

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to close dead connections immediately
Дата
Msg-id 8707.1145932442@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How to close dead connections immediately  ("Andrus" <eetasoft@online.ee>)
Список pgsql-general
"Andrus" <eetasoft@online.ee> writes:
> My ODBC client uses single connection to Postgres 8.1.3 server in W2K
> In case of TCP error it closes connection and re-opens it.
> ...
> Is it possible to force postgres to close dead connections immediately, not
> after 6 hours ?

PG *will* close the connection immediately if it receives any
notification of connection drop from the client.  If it's not seeing
one, that suggests something wrong in your network infrastructure.
I'd suggest fixing the problem rather than kluging the symptom.

You can reduce the TCP timeout settings if you are using PG 8.1 and an
operating system that supports it (I have no idea if Windows does or not).
I wouldn't recommend trying to make it "immediate" since then any
network instability breaks your application.  5 minutes or so might be
reasonable though.  As you've noticed, the default timeouts are usually
upwards of an hour.  (You should however ask yourself if you really know
more about TCP than the authors of the TCP specifications do.)

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to have a blind-superuser
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: How to have a blind-superuser