Home arrow Tuning FreeBSD arrow Tuning a FreeBSD Router
Tuning a FreeBSD Router PDF
Thursday, 03 April 2008
This is a work in progress mini howto. More informations will be added later. Also some aspects are about optimizing a pppoe server built with mpd.

If you've build a router with FreeBSD to serve a huge number of lan users some sysctl tunings can be done:

Add the following options to /etc/sysctl.conf

kern.polling.enable=1
kern.ipc.nmbcluster=32768
kern.ipc.maxsockbufs=2097152
kern.ipc.somaxconn=8192
kern.maxfiles=65536
kern.maxfilesperproc=32768
net.inet.tcp.delayed_ack=0
net.inet.tcp.sendspace=65535
net.inet.udp.recvspace=65535
net.inet.udp.maxdgram=57344
net.local.stream.recvspace=65535
net.local.stream.sendspace=65535


To be able to activate device polling you must recompile kernel with options DEVICE_POLLING and also your nic driver must support polling.

Also add the following options to /boot/loader.conf if you use pppoe server with mpd:

net.graph.maxalloc=512
net.graph.maxdgram=45000
net.graph.recvspace=45000


If you do not increase net.graph.maxdgram and net.graph.recvspace variables you will not be able to connect more than 130 pppoe users (with mpd).

If you've built your traffic shaper with pf packet filter and you use ALTQ HFSC algorythm you will have increase the maximum number of queues permitted by HFSC algorythm:

Edit file: /sys/contrib/altq/altq_hfsc.h
Modify #define HFSC_MAX_CLIENTS 64 to
#define HFSC_MAX_CLIENTS 500

And remember that HFSC is a linear algorythm, it will work fine for hundreads of queues but not for thousands.
 
Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?