From owner-freebsd-net@FreeBSD.ORG Fri Oct 2 19:02:52 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E908106568D for ; Fri, 2 Oct 2009 19:02:52 +0000 (UTC) (envelope-from skip@menantico.com) Received: from vms173015pub.verizon.net (vms173015pub.verizon.net [206.46.173.15]) by mx1.freebsd.org (Postfix) with ESMTP id 319EF8FC15 for ; Fri, 2 Oct 2009 19:02:51 +0000 (UTC) Received: from mx.menantico.com ([71.188.7.134]) by vms173015.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KQW003JVFFB3081@vms173015.mailsrvcs.net> for freebsd-net@freebsd.org; Fri, 02 Oct 2009 13:02:03 -0500 (CDT) Date: Fri, 02 Oct 2009 14:06:21 -0400 From: Skip Ford To: Igor Sysoev Message-id: <20091002180621.GA1168@menantico.com> References: <20091002130646.GC89571@rambler-co.ru> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline In-reply-to: <20091002130646.GC89571@rambler-co.ru> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org Subject: Re: stuck TIME_WAIT sockets 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: Fri, 02 Oct 2009 19:02:52 -0000 Igor Sysoev wrote: > The TIME_WAIT sockets suddenly started to grow on a host running > FreeBSD 7.2-STABLE, date=2009.09.06.23.59.59 > Usually there are 3,000-5,000 TIME_WAIT sockets on the host. > However, today they stared to grow, have reached 110,000 sockets in hour > and still remain on this level. > net.inet.tcp.msl is 30000. > The host uptime is 24 days, 21:53. Perhaps you need this patch? Author: peter Date: Thu Aug 20 22:53:28 2009 New Revision: 196410 URL: http://svn.freebsd.org/changeset/base/196410 Log: Fix signed comparison bug when ticks goes negative after 24 days of uptime. This causes the tcp time_wait state code to fail to expire sockets in timewait state. Approved by: re (kensmith) Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c --- head/sys/netinet/tcp_timewait.c Thu Aug 20 22:39:20 2009 (r196409) +++ head/sys/netinet/tcp_timewait.c Thu Aug 20 22:53:28 2009 (r196410) @@ -603,7 +603,7 @@ tcp_tw_2msl_scan(int reuse) INP_INFO_WLOCK_ASSERT(&V_tcbinfo); for (;;) { tw = TAILQ_FIRST(&V_twq_2msl); - if (tw == NULL || (!reuse && tw->tw_time > ticks)) + if (tw == NULL || (!reuse && (tw->tw_time - ticks) > 0)) break; INP_WLOCK(tw->tw_inpcb); tcp_twclose(tw, reuse); -- Skip