unbound / unbound-plus startup load

Started by dinguz, April 28, 2020, 07:45:19 PM

Previous topic - Next topic
April 28, 2020, 07:45:19 PM Last Edit: April 28, 2020, 08:29:15 PM by dinguz
Ever since I started using unbound-plus, I see very high CPU usage during startup of unbound. I presume this is because it is re-downloading the block-lists at startup.

On further investigation, I noticed that unbound is started before the WAN interface is up (WAN is assigned by DHCP in my case). I am seeing cpu usage of 100% while unbound is waiting for the WAN interface / gateway to come up, then it drops to ~80% while initializing, and after that it normalizes.

Unbound also logs some of these messages:
2020-04-28T14:58:05   unbound: [79599:0] notice: remote address is 95.101.2.60 port 53
2020-04-28T14:58:05   unbound: [79599:0] notice: sendto failed: Permission denied
2020-04-28T14:58:05   unbound: [79599:0] notice: remote address is 95.101.2.55 port 53
2020-04-28T14:58:05   unbound: [79599:0] notice: sendto failed: Permission denied

This happens only while booting the system, not when restarting the service in a running system.

Because of this it seems that:
- unbound is started too early in the booting process, it should wait until the gateway is up and/or the device has Internet connectivity
- it is doing some kind of busy-wait thing while initializing

Would it be possible to solve this in some way?
In theory there is no difference between theory and practice. In practice there is.