]> git.ipfire.org Git - thirdparty/pdns.git/commit
fixes PowerDNS/pdns/#661 1137/head
authorMark Zealey <mark@markandruth.co.uk>
Mon, 2 Dec 2013 09:07:00 +0000 (11:07 +0200)
committerMark Zealey <mark@markandruth.co.uk>
Mon, 2 Dec 2013 09:07:00 +0000 (11:07 +0200)
commit9372d85fb77847b6db4dda55cec249e09610a75e
tree8cfe53230a18366d1cef6554614153fca87b4ac9
parent7874ab05a2073a1bfaea6180bbf2ef01afde9cfd
fixes PowerDNS/pdns/#661

I was doing some performance testing on our 32-way servers and discovered that in the simple case where the test program returns the data straight away, about 80% of the time was being spent in the kernel in a spinlock. I've been debugging this looking at the coprocess code and discovered that this is due to the following line in coprocess.cc:

setbuf(d_fp,0); // no buffering please, confuses select

If this is removed, performance in my particular test case goes from 2000qps with powerdns running at about 2000% cpu to 10000qps with powerdns using about 300% cpu.

Obviously the comment implies that this is not a permanent solution, I guess if the timeout is specified as 0 then the select code won't be executed and so you can disable the setbuf easily enough. However perhaps if the timeout is wanted you could set an alarm() rather than using select?
modules/pipebackend/coprocess.cc
pdns/docs/pdns.xml