Created
February 22, 2012 15:53
-
-
Save abh/1885657 to your computer and use it in GitHub Desktop.
ndns vs native-dns/node-dns benchmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# using dnsperf from http://www.nominum.com/resources/measurement-tools | |
echo ======= | |
echo native-dns | |
echo ======= | |
dnsperf -d test.data -l 8 -p 5302 | |
echo ======= | |
echo ndns | |
echo ======= | |
dnsperf -d test.data -l 8 -p 15353 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* on my test box I get about ~220/qps with this */ | |
"use strict"; | |
var dns = require('../dns'), | |
server = dns.createServer('udp4'); | |
server.bind(15353); | |
server.on('request', function (request, response) { | |
//console.log(request) | |
response.answer.push(dns.A({ | |
name: request.question[0].name, | |
address: '127.0.0.1', | |
ttl: 600, | |
})); | |
response.answer.push(dns.A({ | |
name: request.question[0].name, | |
address: '127.0.0.2', | |
ttl: 600, | |
})); | |
response.send(); | |
}); | |
server.on('error', function (err, buff, req, res) { | |
console.log(err.stack); | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo.pgeodns A |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment