Re: connect() returns EADDRINUSE during massive host->host conn rate



Jan Srzednicki wrote:
On Wed, Nov 28, 2007 at 10:22:08AM -0800, Julian Elischer wrote:
Jan Srzednicki wrote:
Hello,
I have a pair of hosts. One of them performs a massive amount of
TCP connections to the other one, all to the same port. This setup
mostly works fine, but from time to time (that varies, from once a
minute to one a half an hour), the connect(2) syscall fails with EADDRINUSE. The connection rate tops to 50 connection
so, what does netstat -aAn show?

How can I get any usable information from netstat? It shows a bunch of
connections, of course, but since connect(2) failed, I have no idea what
local port I was trying to use.
but you can get an idea of the local socket distribution, and what state all
the sockets are in (TIME_WAIT etc).


And, what I forgot to mention, it's a SMP box, which could matter in
case of some race condition.

hopefully not.





_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Ephemeral port range (patch)
    ... And the algorithm still keeps a *global* IP ID. ... Note that in the case of implementing the double-hash scheme for connection-oriented protocols, once you compute the hash for the first IP ID to be used for a connection, you could store the result of the hash in the TCB, and thus you wouldn't need to recompute this "expensive" hash every time you send a packet. ... If an application does a bindto get a local port before doing a connect, you don't know the remote IP or the remote port. ... This puts a limit on the total number of outgoing connections that one machine can have. ...
    (freebsd-net)
  • Re: Ephemeral port range (patch)
    ... And the algorithm still keeps a *global* IP ID. ... For connection-less transport protocols, while they usually do not implement PMTUD, they also do not implement flow-control or congestion control. ... If an application does a bindto get a local port before doing a connect, you don't know the remote IP or the remote port. ... This puts a limit on the total number of outgoing connections that one machine can have. ...
    (freebsd-net)
  • Re: 65535 outbound connections
    ... there can be multiple connections to one port. ... uniquely defined by local IP, local port, remote IP, remote port. ...
    (Debian-User)
  • Re: connect() returns EADDRINUSE during massive host->host conn rate
    ... TCP connections to the other one, ... local port I was trying to use. ... but you can get an idea of the local socket distribution, ...
    (freebsd-stable)
  • Re: FreeBSD 7.0: sockets stuck in CLOSED state...
    ... In FreeBSD, as with all UNIX/Berkeley sockets systems, each socket is actually represented by a set of data structures representing different layers of abstraction. ... For example, if you close the file descriptor, freeing struct file, the socket and protocol state may persist for some time until the TCP connection closes. ... one is that TCP connections now appear in netstat in the CLOSED state for longer than before, and another is that open sockets that are associated with CLOSED TCP connections now count against the global resource limit on the number of simultaneous TCP connections. ...
    (freebsd-net)