From owner-freebsd-stable@FreeBSD.ORG Mon Sep 11 19:56:19 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5BC4016A4D1; Mon, 11 Sep 2006 19:56:19 +0000 (UTC) (envelope-from marcelo@registro.br) Received: from clone.registro.br (clone.registro.br [200.160.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB0B043D98; Mon, 11 Sep 2006 19:55:22 +0000 (GMT) (envelope-from marcelo@registro.br) Received: by clone.registro.br (Postfix, from userid 1014) id 83C8C2A586; Mon, 11 Sep 2006 16:55:21 -0300 (BRT) Date: Mon, 11 Sep 2006 16:55:21 -0300 From: Marcelo Gardini do Amaral To: freebsd-stable@freebsd.org Message-ID: <20060911195521.GD63300@registro.br> References: <2a41acea0608301145j7bbed961j33ce903a27d8963d@mail.gmail.com> <20060904130827.GE12975@registro.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060904130827.GE12975@registro.br> User-Agent: Mutt/1.4.2.1i Cc: freebsd-net@freebsd.org Subject: DNS query performance X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 19:56:19 -0000 I would like to discuss a little bit more about UDP performance. I've made some tests and the results may have some value here. In this test is easy to see that there is something different in the FreeBSD 6 branch. I made a benchmark with bind 9.3.2 (without threads support) and nsd 3.0.1 (1 server forked) on a HP Proliant Dual AMD Opteron 2.4GHz among FreeBSD 4.11, 6.1 and Linux kernel 2.6.15, all of them for i386 systems. I used this simple zone file: # cat db.FOO.BAR $TTL 86400 @ 172800 in soa foo.dns.bar. hostmaster.foo.bar. ( 2006090601 ;serial 1800 ;refresh 30 minutos 900 ;retry 15 minutos 604800 ;expire 7 dias 900 ) ;negative caching 15 minutos 172800 in ns foo.dns.bar. ; zone delegation begin test1 IN NS qq1.bsd. test2 IN NS qq2.bsd. test3 IN NS qq3.bsd. test4 IN NS qq4.bsd. test5 IN NS qq5.bsd. test6 IN NS qq6.bsd. test7 IN NS qq7.bsd. test8 IN NS qq8.bsd. test9 IN NS qq9.bsd. In another box with the same hardware I used FreeBSD 4.11 and queryperf (DNS Query Performance Testing Tool) as a client to realize 1.000.000 of NS queries on the servers. Below I show the results: queries per second OS Bind 9.3.2 NSD 3.0.1 ---- ---- ---- Linux 2.6 SMP 38845 59645 FreeBSD 4.11 SMP 34977 59417 FreeBSD 4.11 UP 33926 59547 FreeBSD 6.1 SMP 14953 15908 FreeBSD 6.1 UP 15516 14752 Comments: Linux had a performance just 10% better than FreeBSD 4.11 with bind. With nsd I didn't see any difference between them. There is no difference also tweaking the kernel from UP to SMP. With nsd the performance was improved to ~60k queries per second on 4.11 and Linux, i.e., it was almost doubled comparing with bind. I couldn't see any packet loss in any case. On the other hand, on FreeBSD 6.1 the result was lower than half of bind's performance on the others systems tested. And with nsd the result didn't get better (unlike happend on FreeBSD 4.11). I also got some 'timeout' on FreeBSD 6.1 - about 200 from 1M packets were lost. In actual fact, I think that is important to emphasize that the same limit was reached on both name servers - no more than ~15k queries per second was possible on 6.1. I think there is an issue on the system, not on bind neither nsd. Besides this, I've noticed some problems with bge interface driver. Many times the interface is up and running and suddenly goes down, without any reason, or after a reboot it doesn't go up. And if you just remove and insert again the cable, everything returns to work. On up-to-date FreeBSD 6 boxes I don't see this problem so often, but with 'netstat -i' it's possible to find some input errors - I was used to see no errors on 4.11 and others. Does anybody noticed this behavior? For my purpose, the UDP performance is very important. I would be glad with any kind of help to tune my box and improve its performance. For those who wants to try, the queryperf can be found in the bind source tree, at bind-9.3.2/contrib/queryperf. I used a query load file like this (1M of lines making reference to the zones in db.FOO.BAR): # cat query.txt test1.foo.bar NS test7.foo.bar NS test8.foo.bar NS test9.foo.bar NS test2.foo.bar NS ... Cheers, Marcelo Gardini