[Pdns-users] High CPU load with no traffic

Ciro Iriarte 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,
>
>> https://iriarte.it/?p=354
>> 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
>    ...
>
>
> Winfried

Thanks Winfried, all the suggestions were incorporated!

Ref: https://iriarte.it/?p=358

Regards,


-- 
Ciro Iriarte
http://iriarte.it
--




More information about the Pdns-users mailing list