From owner-freebsd-stable@FreeBSD.ORG Tue Dec 25 10:55:50 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 28B6716A41A; Tue, 25 Dec 2007 10:55:50 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from mp2.macomnet.net (mp2.macomnet.net [195.128.64.6]) by mx1.freebsd.org (Postfix) with ESMTP id B744D13C442; Tue, 25 Dec 2007 10:55:49 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from localhost (localhost.int.ru [127.0.0.1] (may be forged)) by mp2.macomnet.net (8.13.7/8.13.8) with ESMTP id lBPAUa5N010042; Tue, 25 Dec 2007 13:30:37 +0300 (MSK) (envelope-from maxim@macomnet.ru) Date: Tue, 25 Dec 2007 13:30:36 +0300 (MSK) From: Maxim Konovalov To: Adrian Chadd In-Reply-To: Message-ID: <20071225133012.M40739@mp2.macomnet.net> References: <20071127135320.GJ2045@oak.pl> <474DB1D0.3010100@elischer.org> <20071128183001.GQ2045@oak.pl> <474DB6B3.1020202@elischer.org> <20071130093628.GS2045@oak.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-net@freebsd.org, Jan Srzednicki , Julian Elischer , 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: Tue, 25 Dec 2007 10:55:50 -0000 On Fri, 30 Nov 2007, 19:26+0900, Adrian Chadd wrote: > On 30/11/2007, Jan Srzednicki wrote: > > > Most of the relevant sockets (that is, between the two host > > mentioned) are in the ESTABLISHED state (200-400 of those). Only > > 20-40 are in TIME_WAIT state (these tend to be from a more > > ephemeric POP3 service). Most of the EADDRINUSE happen for the > > IMAP4 service. > > I'd probably start by patching the places in the tcp code > (src/sys/netinet/tcp_usrreq.c) which returns this error > (Its returned in other places but that seems to me to be the most > likely from your description.) > > Insert some code to print out information about the current socket and > the "oinp" value returned from in_pcbconnect_setup() (if this is the > place where the error occured.) > > Finding out more about the socket thats been created and what its > clashing with might help. I'd do it myself but I'm not sure how to > duplicate the issue. > Have you tried to turn net.inet.ip.portrange.randomized off? -- Maxim Konovalov