Calculating queries per second (BIND 9)

Chris Pile cpile at snoogans.co.uk
Thu May 17 09:58:51 UTC 2001


Hi,

I have been using the following to determine how many queries our caching DNS server performs each second.
Just wondering if this gives a good/accurate reading.  Also might be useful for anyone else.

for i in 1 2 3;do > /var/log/querylog;rndc querylog;sleep 1;rndc querylog;wc /var/log/querylog;sleep 5;done

e.g.

bash-2.04# for i in 1 2 3;do > /var/log/querylog;rndc querylog;sleep 1;rndc querylog;wc /var/log/querylog;sleep 5;done
rndc: querylog command successful
rndc: querylog command successful
     609    6699   61711 /var/log/querylog
rndc: querylog command successful
rndc: querylog command successful
     634    6974   64092 /var/log/querylog
rndc: querylog command successful
rndc: querylog command successful
     473    5203   47435 /var/log/querylog


You will need something like the following in your named.conf:

logging {
    channel my_querylog {
        file "/var/log/querylog" versions 4 size 512K;
        severity dynamic;
        print-category yes;
        print-severity yes;
        print-time yes;
    };
    category queries {
        my_querylog;
    };
};


Look forward to hearing your comments and comparing scores.
I only do the test 3 times (every 5 seconds) to give a better idea of average queries.


Thanks,
Chris.


More information about the bind-users mailing list