Hello John,
I have a bad news for you. The workers config option in Knot DNS 1.6
doesn't work
as you expect. If set to N, the number of UDP workers is N and the
number of TCP workers
is MAX(2*N, 10)! Still there are some background workers and a few other
threads.
The total number of workers is, and usually should be, almost always
higher then the number
of online CPU cores.
There is no universally optimal setup for the number of workers because
it depends
on the number of zones, network card, network latency, number of
slaves/masters and so on.
For this reason the workers configuration in Knot DNS 2.x was extended
to be more explicit
if convenient.
If you really need to limit CPU usage, you should use cgroups or
something like that.
Regards,
Daniel
On 2017-06-26 16:07, knot(a)johnbond.org wrote:
Hello knot,
I have recently started a long over due migration to knot 2.* and I
have noticed that the server.workers config stanza is now split into
three separate stanzas [server.tcp-workers, server.udp-workers &
server.background-workers]. Although this is great for flexibility it
does make automation a little bit more difficult. With the 1.6
configuration I could easily say something like the following
workers = $server_cpu_count - 2
This meant I would always have 2 cpu cores available for other
processes e.g. doc, tcpdump. With the new configuration I would need
to do something like the following
$avalible_workers = $server_cpu_count - 2
$udp_workers = $avalible_workers * 0.6
$tcp_workers = $avalible_workers * 0.3
$background_workers = $avalible_workers * 0.1
The above code is lacking error detection and rounding corrections
which will add further complexity and potentially lacking itelagence
that is available in knot to better balance resources. As you have
already implemented logic in knot to ensure cpus are correctly
balanced I wonder if you could add back a workers configurations to
act as the upper bound used in the *-workers configuration. Such that
*-workes defaults:
"Default: auto-estimated optimal value based on the number of online
CPUs or the value set by `workers` which ever is lower)
Thanks
John
_______________________________________________
knot-dns-users mailing list
knot-dns-users(a)lists.nic.cz
https://lists.nic.cz/cgi-bin/mailman/listinfo/knot-dns-users