Date: Thu, 14 Sep 2006 14:50:49 -0300 From: Marcelo Gardini do Amaral <marcelo@registro.br> To: Robert Watson <rwatson@FreeBSD.org> Cc: freebsd-net@freebsd.org, freebsd-stable@freebsd.org Subject: Re: DNS query performance Message-ID: <20060914175049.GH49126@registro.br> In-Reply-To: <20060913182457.W50147@fledge.watson.org> References: <E1GIMNJ-0000Dd-QH@cs1.cs.huji.ac.il> <2a41acea0608301145j7bbed961j33ce903a27d8963d@mail.gmail.com> <20060904130827.GE12975@registro.br> <20060911195521.GD63300@registro.br> <20060913182019.R50147@fledge.watson.org> <20060913182457.W50147@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> >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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060914175049.GH49126>