This partially reverts
0f0f3ae7dc5da502c1aaf4bb295778d7657a0af5 which
attempted to remove lock contention. However, we are still observing
that Unbound sometimes just seems to hang. This should create multiple
independent threads which could compensate if one of the threads locks
up and is in line with upstream configuration.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
write_tuning_conf() {
# https://www.unbound.net/documentation/howto_optimise.html
+ # Determine number of online processors
+ local processors=$(getconf _NPROCESSORS_ONLN)
+
# Determine amount of system memory
local mem=$(get_memory_amount)
(
config_header
+ # We run one thread per processor
+ echo "num-threads: ${processors}"
+ echo "so-reuseport: yes"
+
# Slice up the cache
echo "rrset-cache-size: $(( ${mem} / 2 ))m"
echo "msg-cache-size: $(( ${mem} / 4 ))m"