From owner-freebsd-net@FreeBSD.ORG Thu Jun 26 09:53:45 2008 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA2261065670 for ; Thu, 26 Jun 2008 09:53:45 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 58E608FC16 for ; Thu, 26 Jun 2008 09:53:44 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:Sender; b=cUhMQ/cdIgb+oy3bGSXlskU6NDjuz4xw0m0RQHCvWmuKVvCUzPGasoRXTlcUdQ/McNaSLRs/6KLP2bfOSrFh0UkRLARQ+TRcuPxGFohCNSIq2OV9RLkc2NSB4D9Tqc4CaCg9NIt0+SKCfG/1li6/Q1fSa+jI3fnjhZqkkJ+Y5Gs=; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1KBo0V-0002wL-6I; Thu, 26 Jun 2008 13:43:11 +0400 Date: Thu, 26 Jun 2008 13:43:10 +0400 From: Eygene Ryabinkin To: net@freebsd.org Message-ID: <5A9ZR/wNTIFIXEvIi7qXj2foxBI@/2P5JkFFETcbMzHSQ1hIkFGHokc> References: <486283B0.3060805@transip.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <486283B0.3060805@transip.nl> Sender: rea-fbsd@codelabs.ru Cc: Ali Niknam Subject: Re: FreeBSD 7.0: sockets stuck in CLOSED state... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jun 2008 09:53:45 -0000 Good day. Wed, Jun 25, 2008 at 07:43:12PM +0200, Ali Niknam wrote: > Recently i've been upgrading some of my machines from FreeBSD 6.x amd64 > to FreeBSD 7.0 amd64. > > After upgrading I noticed a weird error/bug. It seems that after several > thousand TCP connections some seem to hang in 'CLOSED' state. > > netstat -n gives: > ... > tcp4 0 0 1.2.3.4.* 4.5.6.7.42149 CLOSED > tcp4 39 0 1.2.3.4.* 4.5.6.7.54103 CLOSED > tcp4 35 0 1.2.3.4.* 4.5.6.7.41718 CLOSED > tcp4 38 0 1.2.3.4.* 4.5.6.7.55618 CLOSED > tcp4 41 0 1.2.3.4.* 4.5.6.7.44230 CLOSED > tcp4 39 0 1.2.3.4.* 4.5.6.7.49439 CLOSED > ... Just a quick "me too" message: I also used to see this on my 7.x machines. This was with Apache servers in the proxy setup: one Apache was listening to the external requests and routing them to the internal servers that are also running Apache. I refrained from such setup and traded front-end Apache to nginx -- CLOSED sockets gone away. I had already tried to debug this situation and Mike Silbersack helped me with patching the kernel. At that days his patches (that went into 7.x) helped, but with higher request rate to the Apache, they seem to be back again. I can try to setup the testbed and verify if I will still be able to reproduce them. Will it be needed? > These never go away; they gradually increase and increase until the > application starts giving errors (probably because some socket or > filedescriptor limit is reached). When the application is killed these > entries disappear. > > The application in question is a self written DNS server, multithreaded, > and running fine for years without any troubles on both BSD 5.x as well > as 6.x. Also 32bits as well as 64bits on 6.x. Mine was Apache 2.2.x with fork model, no threading. -- Eygene