1

I would like to ask if anyone has encountered a problem where query performance deteriorates after upgrading the bind version. Here are the performance test results for versions 9.16.49, 9.18.25, and 9.12.3-P4:

9.16.49 performance data

Quries amount
sent 135762
completed (99.97%) 135719
lost (0.03%) 43
  • Response codes: NOERROR 135719 (100.00%)
  • Average packet size: request 35, response 51
  • Run time (s): 120.063225
  • Queries per second: 1130.396089
  • Average Latency (s): 0.086731 (min 0.001513, max 0.172726)
  • Latency StdDev (s): 0.019442

9.18.25 performance data

Quries amount
sent 142300
completed 142300
lost 0
  • Response codes: NOERROR 142300 (100.00%)
  • Average packet size: request 35, response 51
  • Run time (s): 120.087726
  • Queries per second: 1184.967063
  • Average Latency (s): 0.084285 (min 0.001735, max 0.199955)
  • Latency StdDev (s): 0.018229

9.12.3-P4 performance data

Quries amount
sent 1016067
completed (100.00%) 1016040
lost (0.00%) 27
  • Response codes: NOERROR 1016040 (100.00%)
  • Average packet size: request 35, response 51
  • Run time (s): 120.014670
  • Queries per second: 8465.965036
  • Average Latency (s): 0.011652 (min 0.001157, max 0.034407)
  • Latency StdDev (s): 0.001628

Deployment environment

  • Operating System: CentOS 7 2009
  • Kernel Version: 3.10.0-1160.92.1.el7.x86_64
  • Current Version: BIND 9.12.3-P4 id:a3d2ae0
  • Tested Versions: BIND 9.16.49 & 9.18.25
  • Testing Tool: dnsperf
  • Relevant Test: 5 domains, 120 seconds of queries using the command (dnsperf -d dnstest.txt -s 10.0.3.12 -l 120) for internal domain names

Compilation commands

9.12.3 and 9.16.49

./configure \
    --prefix=/usr/local/named \
    --sysconfdir=/etc/named \
    --with-dlz-mysql \
    --enable-threads \
    --enable-epoll \
    --disable-chroot \
    --enable-backtrace \
    --enable-largefile \
    --disable-ipv6 \
    --with-openssl \
    --with-libxml2

9.18.25

./configure \
    --prefix=/usr/local/named \
    --sysconfdir=/etc/named \
    --disable-chroot \
    --enable-largefile \
    --with-openssl \
    --with-libxml2

All versions have installed contrib/dlz/modules/mysql.

BIND configuration

options {
   listen-on port 53 { any; };
   listen-on-v6 port 53 { ::1; };
   directory       "/etc/named";
   allow-query     { any; };
   forward first;
   forwarders { 10.0.3.6; 10.0.0.221; 10.0.0.222; };
   recursion yes;
   max-cache-ttl 30;
};

logging {
   channel default_log {
      file "/var/log/bind/named.log" versions 10 size 200m;
      severity dynamic;
      print-category yes;
      print-severity yes;
      print-time yes;
   };
   channel query_log {
      file "/var/log/bind/query.log" versions 10 size 200m;
      severity dynamic;
      print-category yes;
      print-severity yes;
      print-time yes;
   };
   channel error_query_log {
      file "/var/log/bind/error_query.log" versions 1 size 200m;
      severity dynamic;
      print-category yes;
      print-severity yes;
      print-time yes;
   };
   channel resolver_log {
      file "/var/log/bind/resolver.log" versions 10 size 200m;
      severity dynamic;
      print-category yes;
      print-severity yes;
      print-time yes;
   };
   category default {default_log;};
   category queries {query_log;};
   category query-errors {error_query_log;};
   category resolver {resolver_log;};
   category lame-servers {null;};
   category edns-disabled {null;};
};

dlz "Mysql zone" {
   database "dlopen /usr/lib/bind9/dlz_mysql_dynamic.so
      {host=10.0.3.26 dbname=dns ssl=false port=3306 user=dnsuser pass=aaaaabbbbbccccc threads=50}
      {select zone from dns_records where zone = '$zone$' and  view = 'any' limit 1}
      {select ttl,type,if(mx_priority>0,mx_priority,NULL),case when lower(type)='txt' then concat('\"',data,'\"') when lower(type)    =  'soa'  then   concat_ws(' ',  data,  resp_person,  serial,  refresh,  retry,  expire,  minimum)   else   data   end   as   mydata   from   dns_records where zone = '$zone$'   and host = '$record$' and view = 'any'}";
};

1 Answer 1

1

Many, many moons ago ... while running a fleet of BIND9 dns servers, I also noticed this. Based on the compile stuff you posted, you may very well not only recover but gain performance from using GCC compile-time performance optimization? Test it and try it out to see, but I had SIGNIFICANT GAIN. It's even better if your workload is strictly authoritative answers.

Most compilers use -O2 out of the box. Experiment with the -Ofast macro expansion. Read up on it and decide what's best for your specific environment. The gains are worth it!!! You may need to go back and recompile your own openss and libxml2 libraries? If you use what is provided in mainline software repositories, they were compiled to work and deliver average performance across a wide variety of similar hardware platforms. Optimize for the platforms/chipsets that you actually run on and do more than basic optimizations (i.e. -O2).

The differences are immense!!! It's a bit of a pita, but if you remember exactly what you did you can reproduce your efforts with other software as well. The performance improvements are INSANE! You will look like a superhero to everyone. They will hoist you upon their shoulders and carry you about cheering your name. You will be worthy of a cape for your office chair, at last. There will be much rejoicing. Hooray!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .