Re: client socket TIME_WAIT state after PQfinish

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: client socket TIME_WAIT state after PQfinish
Дата
Msg-id AANLkTinh0sM+FwWfAPPfHVu3FkAq4MWtOywqciZLcTq2@mail.gmail.com
обсуждение исходный текст
Ответ на Re: client socket TIME_WAIT state after PQfinish  (Guillaume Du Pasquier <guillaume.dupasquier@sensometrix.ch>)
Ответы Re: client socket TIME_WAIT state after PQfinish  (Nicolas Barbier <nicolas.barbier@gmail.com>)
Список pgsql-hackers
On Mon, Sep 27, 2010 at 12:56 PM, Guillaume Du Pasquier
<guillaume.dupasquier@sensometrix.ch> wrote:
> Dear Nicolas, Dear Robert,
>
> Thank you for your quick answers.
> We do not have such behavior using SSL, how do you explain it ?
> I suppose that openssl is using the setsockopt SO_LINGER that
> removes this behavior. Therefore, there is a RST sent to close
> the socket.
>
> We work with an environment that uses a lot of socket connections.
> Therefore, many file descriptors are opened. If after each
> Sql requests a TIME_WAIT arises we will end up with many
> file descriptors opened. By default the maximum number of file descriptors
> is set to 1024 and we reach that number quite fast.

Hrm.  Does a socket in the TIME_WAIT state count against the number of
open file descriptors?  Certainly, it shouldn't count against the
per-process limit, as the process has already closed it.

> Do you have any advices to get rid of this TIME_WAIT problem ?
> Our client runs on the same machine as the postgresql server.
> Would it be possible to use PF_UNIX sockets ?

Yeah, actually that's the default, if you just run "psql" with no
parameters.  It looks for a socket in /tmp/.s.PGSQL.5432.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: PlaceHolderVars versus join ordering
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: trailing whitespace in psql table output