[ previous ] [ next ] [ threads ]
 
 From:  Michael David Joy <mdjoy at phy dot olemiss dot edu>
 To:  m0n0wall dash dev at lists dot m0n0 dot ch
 Subject:  FreeBSD GigE Tuning
 Date:  Fri, 10 Sep 2004 14:47:35 -0500
Well, after some in depth research, I came across this information for
tuning the FreeBSD net stack.

There's a tuning patch we might want to add, or at least investigate for
the 5.1 release.

http://www-didc.lbl.gov/%7Ejin/network/lion/patches/smbuf.patch.tgz

However this web site provided some very good information.

http://proj.sunet.se/E2E/tcptune.html

Specifically it tells exactly what to tune to get maximum GigE
performance.

"FreeBSD
We haven't been able to get as good results with FreeBSD as with NetBSD,
which is mostly due to linear searching in buffer chains in the
transmit/receive path. FreeBSD 5.2 though gives significantly better
performance that the FreeBSD 4 releases.

Install FreeBSD 4.10-RELEASE or FreeBSD 5.2.1-RELEASE
      * Apply this "netlion" patch.
      * Enter the following line to /boot/loader.conf:
      * kern.ipc.nmbclusters="16384" # Set the number of mbuf clusters
        Reboot your system. Do not try to set the values below too high
	until you have increased nmbclusters - risk of "hanging" the 	network
part of the OS!
      * Command	Description
sysctl net.inet.tcp.rfc1323=1	Activate window scaling and timestamp
options according to RFC 1323.

sysctl ipc.maxsockbuf=[sbmax]	Set maximum size of TCP window.

sysctl net.inet.tcp.recvspace=[wstd]	Set default size of TCP receive
window.

sysctl net.inet.tcp.sendspace=[wstd]	Set default size of TCP transmit
window.

sysctl kern.ipc.nmbclusters	View maximum number of mbuf clusters. Used
for storage of data packets to/from the network interface. Can only be
set att boot time - see above.

sysctl net.inet.tcp.liondmask=7	Used to enable the "netlion" patch
above.

You can enter the values to /etc/sysctl.conf to have them set at
boot-time, as in this example."

# Examples of values to add in /etc/sysctl.conf on FreeBSD
# Note that the actual values may vary according to Your setup.
#
# The following setting can only be set when the kernel is loaded
# and must be set in /boot/loader.conf - it cannot be set here!
#
## kern.ipc.nmbclusters="16384"        # Set the number of mbuf clusters
#
# IMPORTANT NOTE - that must be done BEFORE setting the values below,
# otherwise You will run out of mbufs!

kern.ipc.maxsockbuf=8388608
net.inet.tcp.sendspace=3217968
net.inet.tcp.recvspace=3217968
net.inet.tcp.rfc1323=1

-- 
Michael Joy
HEP - University of Mississippi
mdjoy at phy dot olemiss dot edu