FreeBSD tuning

sysctl kern.ipc.somaxconn=4096

increase max open socket

sysctl kern.ipc.maxsockets=204800

Memory allocated for mbufs cannot be used for any other purpose, so preallocating gigs of RAM for mbufs will actually hurt system performance.

sysctl kern.ipc.nmbclusters=33792

show current mbuf cluster usage

netstat -m

increase max open file desctiptor

sysctl kern.maxfiles=32768
sysctl kern.maxfilesperproc=16384