[Pdns-users] High CPU load with no traffic
cyruspy at gmail.com
Wed Dec 17 06:16:48 UTC 2014
2014-12-16 3:57 GMT-03:00 abang <abang at t-ipnet.net>:
> Hi Ciro,
>> Testing & suggestions are welcome!
> Consider if it isn't more efficient to open the database outside from a
> function. This is cheaper because this way it must only open once at
> startup or at "rec-control reload-lua-script":
> cdb = require("cdb")
> db = assert(cdb.open("/var/lib/powerdns/blacklist.cdb"))
> function preresolve ( remoteip, domain, qtype )
> Furthermore you should be aware of the "0x20-Bit encoding"
> (upper/lowercase) in queries to find it in your database:
> domain = string.lower( domain )
> And it is always safer to limit a loop:
> local i = 0
> while domain ~= "" and i < 100
> i = i + 1
Thanks Winfried, all the suggestions were incorporated!
More information about the Pdns-users