Various things to check.
CONCLUSION: Unbound restarts each time a DHCP lease gets initiated or renewed.
Ideally, Unbound should not restart but simply needs to refresh. Unbound needs to be fixed.
If pfBlockerNG is being used, this could mean upwards of 60 seconds of downtime whilst it reloads any blocklists.
Navigate to System → Advanced > Firewall & Nat:
NOTE: If this figure is too low, it will result in slowness.
The higher this value, the more memory it will use, so be careful setting this too high on systems with low memory.
Navigate to Status → Monitoring.
NOTE: This will show the status of a continuous ping to your default gateway over time.
Check if there is any recent slowness being reported:
Navigate to Diagnostics → Command Prompt.
pciconf -lv | grep -A1 -B3 network
returns:
em0@pci0:1:0:0: class=0x020000 card=0x00008086 chip=0x150c8086 rev=0x00 hdr=0x00 vendor = 'Intel Corporation' device = '82583V Gigabit Network Connection' class = network subclass = ethernet em1@pci0:2:0:0: class=0x020000 card=0x00008086 chip=0x150c8086 rev=0x00 hdr=0x00 vendor = 'Intel Corporation' device = '82583V Gigabit Network Connection' class = network subclass = ethernet em2@pci0:3:0:0: class=0x020000 card=0x00008086 chip=0x150c8086 rev=0x00 hdr=0x00 vendor = 'Intel Corporation' device = '82583V Gigabit Network Connection' class = network subclass = ethernet em3@pci0:4:0:0: class=0x020000 card=0x00008086 chip=0x150c8086 rev=0x00 hdr=0x00 vendor = 'Intel Corporation' device = '82583V Gigabit Network Connection' class = network subclass = ethernet em4@pci0:5:0:0: class=0x020000 card=0x00008086 chip=0x150c8086 rev=0x00 hdr=0x00 vendor = 'Intel Corporation' device = '82583V Gigabit Network Connection' class = network subclass = ethernet em5@pci0:6:0:0: class=0x020000 card=0x00008086 chip=0x150c8086 rev=0x00 hdr=0x00 vendor = 'Intel Corporation' device = '82583V Gigabit Network Connection' class = network subclass = ethernet
NOTE: This shows Intel NICs.
Intel usually works well with pfSense.
If on the otherhand this was not Intel, this could be a cause for the slowness.
Navigate to Diagnostics → Command Prompt.
unbound-control -c /var/unbound/unbound.conf stats_noreset | egrep 'total.num|cache.count'
returns:
total.num.queries=11060 total.num.queries_ip_ratelimited=0 total.num.cachehits=10669 total.num.cachemiss=391 total.num.prefetch=342 total.num.expired=295 total.num.recursivereplies=438 msg.cache.count=2073 rrset.cache.count=4222 infra.cache.count=6734 key.cache.count=174
NOTE: This combines the output of:
Output is:
Navigate to Status → System Logs → System → DNS Resolver.
Check if the DNS Resolver is restarting when this issue occurs.
NOTE: This shows Unbound restarting!
See: https://forum.netgate.com/topic/115482/frequent-unbound-restarts/67
It seems that Unbound restarts when the WAN DHCP lease gets renewed.
A temporary workaround is not to use DHCP.
Other options to try: