Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Dec 1999 07:38:07 -0800 (PST)
From:      pfritz@nap.com.ar
To:        freebsd-gnats-submit@freebsd.org
Subject:   kern/15783: tcp connections linger too long in the timed wait state
Message-ID:  <19991230153807.5B94E14D65@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         15783
>Category:       kern
>Synopsis:       tcp connections linger too long in the timed wait state
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 30 07:40:02 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     Pablo J. Fritz
>Release:        3.3-RELEASE
>Organization:
Network Access Point S.R.L.
>Environment:
not available at this moment, sorry
>Description:
While stress-testing Apache on FreeBSD, we found an out of memory condition. We found that tcp streams are kept in the last stage (the timed wait) for 60 seconds, while the specs say that this state has to last 2 round-trip times. So, if you open and close enough connections per second, you can waste all memory and halt the service. This error was also present in OpenBSD and NetBSD, but they crashed to the kernel when out of memory, while FreeBSD only didn't let more connections to be created until the others timed out.
>How-To-Repeat:
open a connection to the web server, close it, and look at how many seconds it takes to destroy the endpoint and release the memory.
I used netstat -m.
>Fix:
I could alleviate the problem changing the timeout form 60 seconds to 6 seconds, but what should be done is the rewriting of the tcp state machine.
I changed in /usr/src/sys/netinet/tcp_timer.h the value of TCPTV_MSL from 30 seconds to 3 seconds, and rebuilt the kernel.

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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