FreeBSD bad file descriptor fix

Matthew P. Moffitt moffitt.10 at osu.edu
Sun Dec 31 04:03:08 GMT 2000


I'm posting this for the benefit of others who've been asking about the socket set problems using TCP_NODELAY, etc with FreeBSD.

The fix turned out to be pretty simple, FreeBSD really just needed to have it's maxfiles/proc increased.  For my environment I used:

sysctl -w kern.maxfiles=8092
sysctl -w kern.maxfilesperproc=8092

The serious problem was that I was getting miserable dos client writes to the server until I fixed this and changed the socket options to:

socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=4096 SO_RCVBUF=4096

I went from around 100kb/s to 3mb/s with this, network is 100mb/full.

This has caused a modest hit in Win95/NT client performance.  I don't have real benchmarks on it as yet, it appears to be about 10%.

I was using FreeBSD 4.2 (STABLE) when I got it working, but I've run into this since samba 2.0.5 under FreeBSD 3.X.

I realize this isn't much detail, hopefully it will be something for others to work from if they run into it.

-Matt




More information about the samba mailing list