在网上找到一篇关于FreeBSD网络优化的文章,特转记于此:
# ee /etc/sysctl.conf
net.inet.ip.check_interface=1
net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1
net.inet.tcp.recvspace=65535
net.inet.tcp.sendspace=65535
kern.ipc.somaxconn=32768
kern.ipc.maxsockbuf=2097152
net.inet.ip.redirect=0
net.inet.icmp.icmplim=100
net.inet.tcp.always_keepalive=1
net.inet.tcp.delayed_ack=1
net.inet.udp.maxdgram=65535
net.local.stream.sendspace=65535
net.local.stream.recvspace=65535
kern.maxfiles=65536
kern.maxfilesperproc=65536
net.inet.udp.checksum=1
net.inet.tcp.msl=7500
net.inet.tcp.syncookies=1
net.inet.icmp.bmcastecho=0
net.inet.icmp.maskrepl=0
kern.securelevel=0
net.inet.ip.check_interface=1
net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1
net.inet.tcp.recvspace=65535
net.inet.tcp.sendspace=65535
kern.ipc.somaxconn=32768
kern.ipc.maxsockbuf=2097152
net.inet.ip.redirect=0
net.inet.icmp.icmplim=100
net.inet.tcp.always_keepalive=1
net.inet.tcp.delayed_ack=1
net.inet.udp.maxdgram=65535
net.local.stream.sendspace=65535
net.local.stream.recvspace=65535
kern.maxfiles=65536
kern.maxfilesperproc=65536
net.inet.udp.checksum=1
net.inet.tcp.msl=7500
net.inet.tcp.syncookies=1
net.inet.icmp.bmcastecho=0
net.inet.icmp.maskrepl=0
kern.securelevel=0
# ee /boot/loader.conf
kern.maxdsiz="536870912"
kern.ipc.maxsockets="4008"
kern.ipc.nmbclusters="32768"
kern.ipc.nmbufs="65535"
kern.ipc.nsfbufs="2496"
net.inet.tcp.tcbhashsize="2048"
kern.maxdsiz="536870912"
kern.ipc.maxsockets="4008"
kern.ipc.nmbclusters="32768"
kern.ipc.nmbufs="65535"
kern.ipc.nsfbufs="2496"
net.inet.tcp.tcbhashsize="2048"
# shutdown -r now