Solved

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

Posted on 2004-10-07
3
1,694 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 62

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

713 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