Skip to content

CPU usage optimizations - #136

Merged
antoncxx merged 6 commits into
mainfrom
perf/cpu-spike-fixes
Jul 28, 2026
Merged

CPU usage optimizations#136
antoncxx merged 6 commits into
mainfrom
perf/cpu-spike-fixes

Conversation

@antoncxx

Copy link
Copy Markdown
Collaborator

No description provided.

antoncxx and others added 6 commits July 17, 2026 17:24
Replaces the external crate dependency with local code to avoid
maintaining a separately published package for such a small,
single-consumer library.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Temperatures were always empty because pfSense/OPNsense don't load the
coretemp/amdtemp kernel modules by default, so the dev.cpu.N.temperature
sysctls sysinfo reads never existed; now best-effort kldload them before
polling starts.

Disk read/written bytes were always zero on ZFS-rooted boxes (the modern
pfSense/OPNsense default) because sysinfo attributes I/O by matching a
/dev/... device path, but a ZFS root reports its source as a dataset name
instead. Added a FreeBSD-only fallback that resolves the pool backing "/"
via zpool status and reads GEOM's raw devstat counters for just its backing
disks, avoiding double-counting from the partition/label layers stacked on
top of each disk.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… work

Replaces the hand-rolled per-platform socket enumeration (netinfo/sock) with
the listeners crate, removing unshielded blocking Win32 syscalls on the async
executor and a sequential /proc walk. Switches ItemBuffer to VecDeque and
restructures the dump-file retransmission loop to avoid O(n^2) front-drains
on large backlogs. Moves JSON (de)serialization and fireparse config parsing
onto spawn_blocking so large payloads can't stall the shared tokio runtime.
Also caches the config digest instead of re-hashing unchanged content each
tick, parallelizes per-socket HTTP/SSH service probing, fixes a short-circuit
bug in sysconfig's update_all, and trims a couple of small per-tick
allocations in FreeBSD disk-IO and resource monitoring.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
for_kv_map (iterate lock.values() instead of (_, v) in lock.iter()) and
needless_borrow in wallguard-server, plus collapsible_if in the FreeBSD-only
GEOM label-mapping parser (invisible to clippy on non-FreeBSD hosts).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@antoncxx
antoncxx merged commit 15f2b92 into main Jul 28, 2026
2 of 3 checks passed
@antoncxx
antoncxx deleted the perf/cpu-spike-fixes branch July 28, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant