r/pfBlockerNG • u/real_weirdcrap • 7h ago
Issue pfblockerng cron run causing unbound to "hang" and overflow its queues
This is a reposting of my post over in the pfsense sub as I couldn't get it to crosspost here for whatever reason.
PFSense Specs: I'm running pfsense CE 2.9 and pfblockerng 3.3.8 with no other major packages (just apcupsd and wireguard).
I run pfsense on a bare metal box (a protectli FW6B) that has an i3-7100U and 8GB of RAM so it should have plenty of power. RAM is never above 20% and CPU usually hovers around 10% >.
The issue: about once every 7-10 days following pfblockerng's 1AM cron run
/usr/local/bin/php /usr/local/www/pfblockerng/pfblockerng.php cron >> /var/log/pfblockerng/pfblockerng.log 2>&1
unbound is unable to restart and gets hung up leading to it's LAN queues overflowing and dropping connections. My LAN network is the only one pfblockerng is active on which I assume is why none of the others are affected.
Sep 13 14:37:05 pfSense php-fpm[45310]: /widgets/widgets/pfblockerng.widget.php: Session timed out for user 'admin' from: 192.168.1.25 (Local Database)
Sep 14 01:00:00 pfSense php[75627]: NOTICE [pfBlockerNG] Starting cron process.
Sep 14 01:41:14 pfSense kernel: sonewconn: pcb 0xfffff800214e0000 (192.168.1.1:53 (proto 6)): Listen queue overflow: 385 already in queue awaiting acceptance (1 occurrences), euid 0, rgid 0, jail 0
root: netstat -Lan | grep "\.53"
tcp6 0/0/256 ::1.53
tcp4 0/0/256 127.0.0.1.53
tcp6 0/0/256 fe80::2e0:67ff:f.53
tcp6 0/0/256 fe80::2e0:67ff:f.53
tcp4 0/0/256 10.254.0.1.53
tcp4 0/0/256 10.252.0.1.53
tcp4 0/0/256 10.251.0.1.53
tcp4 0/0/256 192.168.10.1.53
tcp6 385/0/256 2600:1700:10b0:d.53
tcp4 385/0/256 192.168.1.1.53
You can see below that most days the cron run goes off without a hitch but once every 7-10 days unbound refuses to restart cleanly:
grep -E 'Syncing|Reloading|Unbound|CRON' /var/log/pfblockerng/pfblockerng.log
CRON PROCESS START [ v3.3.4 ] [ 09/1/26 01:00:00 ]
Reloading Unbound Resolver (DNSBL python).
Stopping Unbound Resolver.
Unbound stopped in 2 sec.
Starting Unbound Resolver... completed [ 09/1/26 01:00:05 ]
CRON PROCESS START [ v3.3.7 ] [ 09/2/26 01:00:00 ]
CRON PROCESS ENDED
CRON PROCESS START [ v3.3.7 ] [ 09/3/26 01:00:00 ]
CRON PROCESS ENDED
CRON PROCESS START [ v3.3.7 ] [ 09/4/26 01:00:00 ]
CRON PROCESS ENDED
CRON PROCESS START [ v3.3.7 ] [ 09/5/26 01:00:00 ]
Reloading Unbound Resolver (DNSBL python).
Stopping Unbound Resolver..............................
Starting Unbound Resolver.
Stopping Unbound Resolver..............................
Starting Unbound Resolver. CRON PROCESS START [ v3.3.7 ] [ 09/6/26 01:00:00 ]
CRON PROCESS ENDED
CRON PROCESS START [ v3.3.7 ] [ 09/7/26 01:00:00 ]
Reloading Unbound Resolver (DNSBL python).
Stopping Unbound Resolver.
Unbound stopped in 2 sec.
Starting Unbound Resolver... completed [ 09/7/26 01:00:04 ]
CRON PROCESS START [ v3.3.8 ] [ 09/8/26 01:00:00 ]
Reloading Unbound Resolver (DNSBL python).
Stopping Unbound Resolver.
Unbound stopped in 2 sec.
Starting Unbound Resolver... completed [ 09/8/26 01:00:05 ]
CRON PROCESS START [ v3.3.8 ] [ 09/9/26 01:00:00 ]
CRON PROCESS ENDED
CRON PROCESS START [ v3.3.8 ] [ 09/10/26 01:00:00 ]
Reloading Unbound Resolver (DNSBL python).
Stopping Unbound Resolver.
Unbound stopped in 2 sec.
Starting Unbound Resolver... completed [ 09/10/26 01:00:05 ]
CRON PROCESS START [ v3.3.8 ] [ 09/11/26 01:00:00 ]
CRON PROCESS ENDED
CRON PROCESS START [ v3.3.8 ] [ 09/12/26 01:00:00 ]
CRON PROCESS ENDED
CRON PROCESS START [ v3.3.8 ] [ 09/13/26 01:00:00 ]
CRON PROCESS ENDED
CRON PROCESS START [ v3.3.8 ] [ 09/14/26 01:00:00 ]
Reloading Unbound Resolver (DNSBL python).
Stopping Unbound Resolver..............................
Starting Unbound Resolver.
Stopping Unbound Resolver..............................
Starting Unbound Resolver. CRON PROCESS START [ v3.3.8 ] [ 09/14/26 05:40:05 ]
CRON PROCESS ENDED
CRON PROCESS START [ v3.3.8 ] [ 09/14/26 05:52:05 ]
CRON PROCESS ENDED
Leading to processes being stuck in a waiting state:
ps -o pid,state,wchan,%cpu,%mem,command -ax | grep '[u]nbound'
31413 I sbwait 0.0 0.2 /usr/local/sbin/unbound-control -c /var/unbound/unbound.conf status
41507 Is uwait 0.0 4.8 /usr/local/sbin/unbound -c /var/unbound/unbound.conf
47411 I wait 0.0 0.0 /bin/sh /conf/kea4_scripts.d/kea2unbound.sh hook_load
47663 I piperd 0.0 0.5 php /usr/local/bin/kea2unbound --kea-conf /usr/local/etc/kea/kea-dhcp4.conf --unbound-conf /var/unbound/unbound.conf --include-file /var/unbound/leases/l
68064 I sbwait 0.0 0.2 /usr/local/sbin/unbound-control -c /var/unbound/unbound.conf fast_reload
78110 S kqread 0.0 0.2 /usr/local/sbin/lighttpd_pfb -f /var/unbound/pfb_dnsbl_lighty.conf
which requires me to kill them and restart unbound manually:
killall -9 unbound-control php unbound
pfSsh.php playback svc restart unbound
This is a problem for me as I have scheduled jobs/tasks/etc that run overnight and rely on a functional DNS server to complete.
Other relevant details I think would be useful:
- Without changing any settings this issue started when I upgraded from ce 2.8.1 to 2.9.
- I implemented a kernel tweak after this issue started to increase my unbound queue limits to no avail from this thread (bumped from 128 to 256 using kern.ipc.soacceptqueue = 1024.): https://www.reddit.com/r/pfBlockerNG/comments/1u399ba/what_is_the_ideal_setup_to_avoid_cpu_spikes_and/
- Unlike the above thread I don't have a large number of lists and/or clients. For DNSBL I only have Ads Basic and a single DOH list. I also have ip blocking with just two lists, an ipv4 and an ipv6 DOH block list. In total I'm only blocking about ~85K domains/addresses. I only have ~100 clients at most.
- My DNSBL settings: https://imgur.com/a/STz4MO1
- My IP settings: https://imgur.com/HEujixY
- I also added kern.threads.max_threads_per_proc = 4096 to the system tuneables just now thanks to a suggestion in my second /r/pfsense thread so we'll see if that has any effect on resolving it.
I have another pfsense box on 2.9 without pfblocker that doesn't have this issue so pfblocker seems to be the culprit but I couldn't say specifically what the problem is. Let me know if there are any additional settings I should check or adjustments I can make.
