About the performance of BIND? --- oops, attachement stripped

Jay C Austad JCA at BigCharts.com
Sat May 13 00:31:20 UTC 2000


Here it is --  btw, the fail requests portion doesn't work right.

======================
#!/usr/bin/perl

$limit = $ARGV[0];

if ((!defined $ARGV[0]) && (!defined $ARGV[1])) {
	print "Usage: nstest2.pl <samples> <host> [nameserver]\n";
	exit 1;
}

if (!defined $ARGV[2]) {
	$nameserver = '0.0.0.0';
	} else
		{
			$nameserver = $ARGV[2];
		}

for ($loop_index = 1; $loop_index <= $limit; $loop_index++) {
	@ips = ((`nslookup $ARGV[1] $nameserver`) =~ m/Addresses:  (\d+)\.(\d+)\.(\d+)\.(\d+),/);
	$ip = join("\.", @ips);
	if (!defined $hash{$ip}) {
		$hash{$ip} = 1;
	 } else
        {
            $hash{$ip}++;
		}
	undef @ip;
}

$failed = $limit;

foreach $key (sort keys %hash) {
	$percent = ($hash{$key} / $limit) * 100;
	print "$key => $hash{$key} => $percent\%\n";
	undef $percent;
	$failed = $failed - $hash{$key};
}
print "==========  $failed requests failed  ==========\n";


-----Original Message-----
From: Jay C Austad 
Sent: Friday, May 12, 2000 5:59 PM
To: 'koancui'; comp-protocols-dns-bind at uunet.uu.net
Subject: RE: About the performance of BIND?


I whacked up a test script to test a hacked version of bind we had here.  I attached the script.  On line 17, you'll notice that it looks for a line called Addresses:, this is because we had multiple hosts with the same name.  If you want to make it work out of the box, add 2 lines to your zone file:
test  IN 	A 	x.x.x.x
test	IN	A	x.x.x.x

And run the script against test.yourdomain.com.  I usually start it with:
time nstest2.pl 100000 test.mydomain.com <ip of my nameserver>

Then divide the number of samples, in this case 100000, by the number of seconds it took to finish the script.  I suggest running it on a separate machine, or multiple machines because it's a CPU hog.

I whacked it together in like 5 minutes, so don't make fun of it too much. :)

----------
Jay Austad
Network Administrator
CBS Marketwatch
612.817.1271
jaustad at bigcharts.com
http://cbs.marketwatch.com
http://www.bigcharts.com





-----Original Message-----
From: koancui [mailto:koancui at dnrc.bell-labs.com]
Sent: Friday, May 12, 2000 3:58 PM
To: comp-protocols-dns-bind at uunet.uu.net
Subject: About the performance of BIND?


Hi,
Is there someone know how to measure the performance of BIND?
such as the number of queries per second, if given some conditions,
for example, all of the queries can be found in the zone files.
Thanks.
--
Koan






More information about the bind-users mailing list