From owner-freebsd-net@FreeBSD.ORG Mon Apr 5 15:02:54 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2054516A4CE for ; Mon, 5 Apr 2004 15:02:54 -0700 (PDT) Received: from mailtoaster1.pipeline.ch (mailtoaster1.pipeline.ch [62.48.0.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 59D4E43D41 for ; Mon, 5 Apr 2004 15:02:53 -0700 (PDT) (envelope-from andre@freebsd.org) Received: (qmail 72077 invoked from network); 5 Apr 2004 22:02:52 -0000 Received: from unknown (HELO freebsd.org) ([62.48.0.53]) (envelope-sender ) by mailtoaster1.pipeline.ch (qmail-ldap-1.03) with SMTP for ; 5 Apr 2004 22:02:52 -0000 Message-ID: <4071D78C.9B03AEA1@freebsd.org> Date: Tue, 06 Apr 2004 00:02:52 +0200 From: Andre Oppermann X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Brandon Erhart References: <6.0.2.0.2.20040404152043.01c83320@mx1.erhartgroup.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-net@freebsd.org Subject: Re: FIN_WAIT_[1,2] and LAST_ACK X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Apr 2004 22:02:54 -0000 Brandon Erhart wrote: > > Hello everyone, > > I am writing a network application that mirrors a given website (such as a > suped-up "wget"). I use a lot of FDs, and was getting connect() errors when > I would run out of local_ip:local_port tuples. I lowered the MSL so that > TIME_WAIT would timeout very quick (yes, I know, this is "bad", but I'm > going for sheer speed here), and it alleviated the problem a bit. You should enlarge the local port space especially on 4.9: sysctl -w net.inet.ip.portrange.hifirst=10000 sysctl -w net.inet.ip.portrange.hilast=65535 Normal is 49152 which give you only 16383 ports to choose from. And with the number of connections you have you're running of them because of the TIME_WAIT states. -- Andre > However, I have run into a new problem. I am getting a good amount of > blocks stuck in FIN_WAIT_1, FIN_WAIT_2 or LAST_ACK that stick around for a > long while. I have been unable to find must information on a timeout for > these states. I came across a small patch that modified tcp_timer.c in > /usr/src/sys/netinet. It changed line #484 (in FreeBSD 4.9-REL) from: > > if (tp->t_state != TCPS_TIME_WAIT && > > to > > if (tp->t_state < FIN_WAIT_2 && > > I also tried changing that to ".. <= FIN_WAIT_2 .." > > However, I still end up with quite a few stuck in FIN_WAIT_1, FIN_WAIT_2 or > LAST_ACK after the program exits (and whilst the program is running of > course). They don't seem to timeout in the same interval that TIME_WAIT does. > > Any ideas? Did I modify the right piece of code? I was told to post here as > you all would more than likely know! > > I am stumped. > > Thank you all in advance, > > Brandon > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"