DNS query performance
Marcelo Gardini do Amaral
marcelo at registro.br
Thu Sep 14 10:50:55 PDT 2006
> >Are you able to boot a 7.x kernel on this box? An as yet un-MFC'd
> >optimization to the UDP send path is present in the 7.x kernel, suggested
> >by ISC, which significantly improves threaded BIND9 performance. I've not
> >benchmarked unthreaded BIND9 with the change. If you want to test
> >specifically the before/after case for that change, you can find the
> >reference to sosend_dgram in src/sys/netinet/udp_usrreq.c and swap it to
> >sosend, which restores the old behavior.
I booted 7.x kernel UP and SMP on my blade. When I swaped both of
them to sosend I got a panic to any DNS query:
# dig @localhost test1.foo.bar
panic: sosend: protocol calls sosend
KDB: enter: panic
[thread pid 671 tid 100053 ]
Stopped at kdb_enter+0x2b: nop
db>
db> bt
Tracing pid 671 tid 100053 td 0xc4a52bd0
kdb_enter(c091d7b6) at kdb_enter+0x2b
panic(c0925143,e502dc10,c06e6511,c4f9c14c,c4a66370,...) at panic+0xbb
sosend(c4f9c14c,c4a66370,e502dbe4,0,0,0,c4a52bd0) at sosend+0x1f
kern_sendit(c4a52bd0,15,e502dc5c,0,0,0) at kern_sendit+0x101
sendit(c4a52bd0,15,e502dc5c,0,c4a66150,...) at sendit+0x87
sendmsg(c4a52bd0,e502dd04) at sendmsg+0x53
syscall(3b,3b,3b,1,0,...) at syscall+0x256
Xint0x80_syscall() at Xint0x80_syscall+0x1f
--- syscall (28, FreeBSD ELF32, sendmsg), eip = 0x28353d6f, esp =
0xbfbfe8ec, eb
p = 0xbfbfea68 ---
db> c
Uptime: 1m44s
Physical memory: 2039 MB
Dumping 99 MB: 84 68 52 36 20 4
Dump complete
Automatic reboot in 15 seconds - press a key on the console to abort
> The other common optimization advice that you may already have received is
> to check which time counter FreeBSD has selected. Right now, 6.x/7.x err
> on the side of accurate over fast. There's been quite a bit of debate
> about this approach, and it's useful to investigate the issue. You can
> view and set the current choice by looking at the sysctl
> kern.timecounter.hardware, and you can see the choices on your hardware by
> looking at kern.timecounter.choice. Typically, TSC is the fastest, but may
> suffer from drift as the CPU changes speed (as a result of temperature,
> power saving, etc). Set it to TSC if it's not already TSC, and see what
> the effect is. As many event libraries read time stamps frequently to set
> up sleeping in user space, it can have a substantial performance impact.
With the 7.x kernel and no changes in src/sys/netinet/udp_usrreq.c I
tried different timecounters and I couldn't see any performance
difference. Here we see the results for bind 9.3.2, same zone file and
queries:
Kernel UP
Timecounter queries/s
----------- ---------
ACPI-safe 16200
TSC 16584
i8254 16319
Kernel SMP
Timecounter queries/s
----------- ---------
ACPI-safe 15323
TSC 15930
i8254 14155
Any other tip?
--
Att.,
Marcelo Gardini
More information about the freebsd-net
mailing list