How to determine BIND query rates (qps)
  • 20 Sep 2018
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

How to determine BIND query rates (qps)

  • Dark
    Light
  • PDF

Article Summary

Question:

How can I find out what query rate my BIND nameserver is handling?

Answer:

This answer is incomplete
There are other ways of determining the QPS of a server. This answer provides guidance for the one that is expected to be applicable to the most BIND versions and with a minimum of setup fuss.

BIND produces some basic statistics that can be output to a file.

First you need to enable the statistics by specifying the output file in named.conf in the options section:

statistics-file "/var/named/named.stats";

The example above shows the default file name and location - you can name and place it anywhere that the named daemon will be able to write to it.

You also need to make sure that you can control the named daemon using rndc. You can refer to the BIND 9 Administrator Reference Manual for more details on how to do this.

Restart named (which resets the statistics counters). 

For a quick estimate of query rate over 24 hours , run named for this period and then use rndc to dump the statistics that have been collected over this period:

rndc stats

Add together the first two entries in the output and then divide by the number of seconds that named has been running for. The entries in the file will look something like this:

++ Incoming Requests ++
          402314 QUERY
            2809 UPDATE

You might only see a QUERY counter
Not all servers receive dynamic updates - in which case just use the query count when calculating qps.

For more sophisticated monitoring of query rates, you can schedule rndc stats to run more frequently (every hour or every 5 minutes or less) and then use scripting techniques or import the statistical data into an analysis tool so that you can see fluctuating query rates over time - and in particular to observe your peak query rates.