From owner-freebsd-stable@FreeBSD.ORG Wed Nov 28 18:43:04 2007 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9362016A46B for ; Wed, 28 Nov 2007 18:43:04 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outW.internet-mail-service.net (outW.internet-mail-service.net [216.240.47.246]) by mx1.freebsd.org (Postfix) with ESMTP id 615FD13C46E for ; Wed, 28 Nov 2007 18:43:01 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Wed, 28 Nov 2007 10:43:00 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (nat.ironport.com [63.251.108.100]) by idiom.com (Postfix) with ESMTP id 1524F126B23; Wed, 28 Nov 2007 10:43:00 -0800 (PST) Message-ID: <474DB6B3.1020202@elischer.org> Date: Wed, 28 Nov 2007 10:42:59 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Jan Srzednicki References: <20071127135320.GJ2045@oak.pl> <474DB1D0.3010100@elischer.org> <20071128183001.GQ2045@oak.pl> In-Reply-To: <20071128183001.GQ2045@oak.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, freebsd-stable@freebsd.org Subject: Re: connect() returns EADDRINUSE during massive host->host conn rate X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2007 18:43:04 -0000 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. >