Solved

Clearing hung CLOSE_WAIT TCP/IP  connections on a FreeBSD server.

Posted on 2004-10-07
3
1,628 Views
Last Modified: 2013-11-22
I am using proftpd on  a FreeBSD 4.0 server.  After I disconnect from the ftp server there are multiple TCP connections in the CLOSE_WAIT state when I run a netstat.

tcp4       0      0  mymachine.ftp           x.x.x.5.4964        CLOSE_WAIT
tcp4       0      0  mymachine.ftp           x.x.x.4.4956        CLOSE_WAIT

Here is what I have in the proftpd.conf file

TimeoutLogin                    120
TimeoutIdle                      300
TimeoutNoTransfer            600
TimeoutStalled                  900
TimeoutSession                 1000

I also run ipfw on this server and tried the following commands to get rid of these hung connections:
net.inet.ip.fw.dyn_ack_lifetime=400

Is there a way I can make these CLOSE_WAIT sessions expire quickly?
0
Comment
Question by:mvars
3 Comments
 
LVL 61

Accepted Solution

by:
gheist earned 500 total points
ID: 12252336
This is normal behavior.
Use maxusers=512 if this hits any system limits (I doubt).

These parameters affect this aspect of network
net.inet.tcp.keepidle: 7200000
net.inet.tcp.keepintvl: 75000
net.inet.tcp.keepinit: 75000
net.inet.tcp.always_keepalive: 1

(times in slowhz, i.e. half-seconds)
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now