Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jun 2008 13:43:10 +0400
From:      Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To:        net@freebsd.org
Cc:        Ali Niknam <freebsd-net@transip.nl>
Subject:   Re: FreeBSD 7.0: sockets stuck in CLOSED state...
Message-ID:  <5A9ZR/wNTIFIXEvIi7qXj2foxBI@/2P5JkFFETcbMzHSQ1hIkFGHokc>
In-Reply-To: <486283B0.3060805@transip.nl>
References:  <486283B0.3060805@transip.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5A9ZR/wNTIFIXEvIi7qXj2foxBI>