[Pdns-users] Pdns Remote vs Pipe backend performance
Aleksey Chudov
aleksey.chudov at gmail.com
Wed Mar 6 14:01:47 UTC 2013
Hello,
I have a custom written Java application which I would like to use as a
PowerDNS backend. After examining documentation I have come to the
conclusion that Pipe and Remote backends suitable for my needs.
Because of the java application architecture is difficult to use it
through the pipe. So, to compare the performance of different backends,
I asked our programmers to implement in our java application support for
Pipe protocol over unix socket and Remote protocol over unix socket and
Remote over http.
Unfortunately In the current implementation PowerDNS Pipe can not pass
parameters to the application. So I had to change coprocess.cc code to
connect from PowerDNS Pipe and Remote Pipe to the unix socket using
socat binary.
--- pdns-3.2.orig/modules/pipebackend/coprocess.cc 2013-01-17
13:16:53.000000000 +0400
+++ pdns-3.2/modules/pipebackend/coprocess.cc 2013-03-02
15:12:04.415022452 +0400
@@ -9,12 +9,20 @@
#include <sys/wait.h>
#include <pdns/misc.hh>
#include <pdns/ahuexception.hh>
+#include <boost/algorithm/string.hpp>
+#include <vector>
CoProcess::CoProcess(const string &command,int timeout, int infd, int
outfd)
{
- const char *argv[2];
- argv[0]=strdup(command.c_str());
- argv[1]=0;
+ vector <string> v;
+
+ split(v, command, is_any_of(" "));
+
+ const char *argv[v.size()+1];
+
+ for (size_t n = 0; n < v.size(); n++)
+ argv[n]=strdup(v[n].c_str());
+ argv[v.size()]=0;
launch(argv,timeout,infd,outfd);
}
After making these changes it is possible to set one of the following
parameter in the configuration file to test different backends
# For remote backend
remote-connection-string=http:url=http://127.0.0.1:8090/dnsapi
remote-connection-string=unix:path=/var/run/pdns/remote.sock
remote-connection-string=pipe:command=/usr/bin/socat stdio
unix-connect:/var/run/pdns/remote.sock
# For pipe backend
pipe-command=/usr/bin/socat stdio unix-connect:/var/run/pdns/pipe.sock
All tests were conducted on a dedicated physical server with the
following configuration
ETegro Hyperion RS130 G3 / 2x Intel E5620 @ 2.40GHz / 16GB RAM /
PowerDNS + Pipe or Remote backend
PowerDNS running with the following configuration
cache-ttl=0
distributor-threads=1/7 (maximum performance achieved with
distributor-threads = 7)
launch=remote/pipe
query-cache-ttl=0
16 dedicated physical servers are used as DNS clients. Each server
running two instances of dnsperf with the following parameters
dnsperf -d dnsperf1.txt -s 1.1.1.1
dnsperf -d dnsperf2.txt -s 1.1.1.1
Content of dnsperf1.txt
test1.example.com. A
Content of dnsperf2.txt
test2.example.com. A
Results
|PowerDNS Backend|Threads|Transaction rate|
|PowerDNS 3.2 + Remote HTTP|1|1700|
|PowerDNS 3.2 + Remote HTTP|7|8973|
|PowerDNS 3.2 + Remote Socket|1|7043|
|PowerDNS 3.2 + Remote Socket|7|28205|
|PowerDNS 3.2 + Remote Pipe + Socat|1|4215|
|PowerDNS 3.2 + Remote Pipe + Socat|7|15898|
|PowerDNS 3.2 + Pipe + Socat|1|4786|
|PowerDNS 3.2 + Pipe + Socat|7|25926|
As seen the fastest backend is Remote over unix socket.
If compare Pipe + Socat and Remote Pipe + Socat the second is much
slower. It can be concluded that the Pipe protocol is the fastest. This
is logical because Pipe protocol is simpler than Remote protocol.
In connection with the above, I have a few questions.
Can someone of PowerDNS developers implement support for passing
parameters to pipe:command and pipe-command? (example above)
Can someone of PowerDNS developers implement support for pipe protocol
over unix socket? (as already implemented for remote protocol)
Regards,
Aleksey
More information about the Pdns-users
mailing list