From: | Rene Pijlman <rene(at)lab(dot)applinet(dot)nl> |
---|---|
To: | Palle Girgensohn <girgen(at)partitur(dot)se> |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: SocketException on connect, busy server |
Date: | 2001-09-07 00:37:36 |
Message-ID: | r84gptc24eemnv0icjh2e7to271u86rark@4ax.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
On Sun, 02 Sep 2001 23:41:49 +0200, you wrote:
>On a busy server, serving web pages using tomcat and apache, I
>get this error sometimes:
>
>java.net.SocketException: errno: 48, error: Address already in
>use for fd: 168
> at java.net.PlainSocketImpl.socketConnect(Native
>Method)
This means the underlying connect(2) socket call returns errno
EADDRINUSE.
On a connect(), this means that the 5-tuple <protocol,local
address,local port,remote address,remote port>
would not be unique if the operation had been allowed. Since
protocol, local address, remote address and remote port are
fixed, this occurs if the local socket implementation cannot
provide a local port number that is still available with respect
to the 4 fixed parts. The port number is a 16 bit number, ports
0-1024 are usually not available as dynamically allocated,
leaving 64511 ports available. TCP defines a 4 minute TIME_WAIT
state, so there can be no more than 64511 / 4 * 60 = 268
connections per second from a single client IP address to one
particular service.
This is usually only a problem with load balancing HTTP servers
and other stateless protocols, not with database servers, since
database connections are typically pooled. Is your application
opening and closing PostgreSQL connections at such a high rate?
In any case, you should probably attack this problem at the TCP
implementation level of your OS. It is most likely not
PostgreSQL specific.
Google gives some interesting hits:
http://www.google.com/search?q=time%5Fwait
Regards,
René Pijlman <rene(at)lab(dot)applinet(dot)nl>
From | Date | Subject | |
---|---|---|---|
Next Message | Rene Pijlman | 2001-09-07 00:42:46 | Re: SocketException on connect, busy server |
Previous Message | T.R.Missner | 2001-09-07 00:14:27 | Re: error - NOTICE: current transaction...MORE DETAIL... |