Unbound python performance 1.9.4

George Thessalonikefs george at nlnetlabs.nl
Mon Nov 4 17:21:53 UTC 2019


Hi Eduard,

There are two issues here:

1. There is a bug in unbound-checkconf that does not treat multiple
Python instances as valid configuration
(https://github.com/NLnetLabs/unbound/issues/103).
If you want you could bypass that by editing your systems's service file
and commenting out the `unbound-checkconf` invocation.

2. The module configuration lists the modules that will be called *in
series* for a given query. The multiple Python instances will allow for
different logic to exist in two or more Python modules. It won't make
sense to run the same Python script (logic) in another Python instance,
and what you are trying to achieve (parallelization) is not possible
that way.

When the Python module is enabled, unbound's performance is hindered by
Python's performance (more so depending on the logic/cost of the custom
code).

Best regards,
-- George

On 03/11/2019 19:36, Eduard Ahmatgareev via Unbound-users wrote:
> How is it possible to enable multiple python instances for get  more
> performance?
> 
> I tried to add next:
> module-config: "validator python python iterator"
> 
> python:
>     python-script: "/etc/unbound/dnsrabbit.py"
>     python-script: "/etc/unbound/dnsrabbit.py"
> 
> but after restart unbound, I got: 
>  unbound-checkconf[15820]: [1572806018] unbound-checkconf[15820:0] fatal
> error: module conf 'validator python python iterator' is not known to work
> 
> 
> I use our own custom python script for extend unbound functionality, but
> unfortunately after testing I found that unbound can process only 14k
> queries per second on ec2 amazon instance
> c4.xlarge Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz
> 
> num-threads: 8
> 
> 
> Version 1.9.4
> 
> Configure line: --build=x86_64-redhat-linux-gnu
> --host=x86_64-redhat-linux-gnu --program-prefix=
> --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
> --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
> --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
> --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib
> --mandir=/usr/share/man --infodir=/usr/share/info --with-pythonmodule
> --with-pyunbound PYTHON=/usr/bin/python2 --with-libevent --with-pthreads
> --with-ssl --disable-rpath --disable-static
> --with-conf-file=/etc/unbound/unbound.conf
> --with-pidfile=/var/run/unbound/unbound.pid --enable-sha2 --disable-gost
> --enable-ecdsa --with-rootkey-file=/var/lib/unbound/root.key
> Linked libs: libevent 2.0.21-stable (it uses epoll), OpenSSL 1.0.2k-fips
>  26 Jan 2017
> Linked modules: dns64 python respip validator iterator
> 
> 



More information about the Unbound-users mailing list