Unbound on FreeBSD

Hi,

I am deploying a couple of unbound hosts on FreeBSD 7.2 Stable and was wondering if there are any OS tweaks you would recommend to get the best performance. Will be doing around 10000 qps at peak times.

Boxes have 4 Gigs Memory and unbound 1.3.4 is being built from ports with both LIBEVENT and THREADS selected.

unbound.conf is as follows

server:

use all CPUs

num-threads: 2

power of 2 close to num-threads

msg-cache-slabs: 2
rrset-cache-slabs: 2
infra-cache-slabs: 2
key-cache-slabs: 2

outgoing-range: 4096
num-queries-per-thread: 4096

more cache memory, rrset=msg*2

rrset-cache-size: 512m
msg-cache-size: 256m
verbosity: 1
statistics-interval: 0
extended-statistics: yes
statistics-cumulative: no
interface: 127.0.0.1
interface: x.x.x.x
outgoing-interface: x.x.x.x
port: 53
do-ip6: no
access-control: 0.0.0.0/0 allow_snoop
access-control: 127.0.0.1 allow_snoop
chroot: “”
username: “unbound”
directory: “/usr/local/etc/unbound”
logfile: “/var/log/unbound/unbound.log”
log-time-ascii: yes
pidfile: “/var/run/unbound.pid”
root-hints: “/usr/local/etc/unbound/root.servers”
hide-identity: yes
hide-version: yes
harden-glue: yes

Remote control config section.

remote-control:

Enable remote control with unbound-control.

control-enable: yes

what interfaces are listened to for remote control.

control-interface: 127.0.0.1

Thanks for your time

Cheers

Gareth

Hi,

You should watch for full socket buffers:
    # netstat -s -p udp
and increase them if you see drops:
    # sysctl kern.ipc.maxsockbuf=1048576
    # /usr/local/etc/rc.d/unbound restart

btw in unbound 1.4.0 (it's already in ports) you can specify:
    so-rcvbuf: 4m

Also if you are using firewall, watch for number of state table
entries and lower udp.* timeouts for incoming queries and outgoing
recursion rules.

Hi Artis,

Thanks for the reply.

That’s pretty much the setup I have. Have just upgraded to 1.4.0, have a stateless firewall ruleset for all port 53 traffic, have set the maxsockbuf to 4194304 and have so-rcvbuf set to 4m in unbound.conf

Will do some tests and see what the performance is like.

Cheers