http://proj.sunet.se/E2E/tcptune.htmlFreeBSD
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.