Skip to content

v1.15.0

Choose a tag to compare

@gsjonio gsjonio released this 11 Jul 20:59

Resilience-under-load fixes from a performance/availability audit, over v1.14.1. Minor bump: one long-running behavior change (device eviction).

Install

go install github.com/gsjonio/netwp/cmd/netwp@v1.15.0

Already have netwp? netwp update.

Fixes (availability)

  • Bounded the port-probe socket fan-out. tcpprobe opened one socket per port with no cap; at ~29 ports times discovery's 32-device fan-out that peaked near 900 concurrent sockets, enough to hit the file-descriptor limit (Linux default 1024) on a busy /24 and fail the scan. Now capped at 16 concurrent dials per device (whole-scan peak ~512). Trade-off: a scan is ~1s slower on a /24 (two probe waves), in exchange for not falling over.
  • Bounded the tracker's device map. A long monitor/dashboard session never forgot departed devices, so the map grew unbounded under MAC randomization (phones rotate MACs) or address spoofing. Devices offline past a 30-minute retention window are now evicted. A device that just left keeps its recent history.

Performance

  • Speedtest upload streams its payload instead of allocating 10 MB up front each run (io.LimitReader over a zero source).
  • Dropped a redundant strings.ToUpper in the OUI vendor lookup (%X is already uppercase).

Notes

The audit's honest conclusion: netwp has no packet-capture hot path — it's I/O-latency-bound, not CPU/alloc-bound — so there was nothing to micro-optimize. These four are resilience and cleanup, not speed chasing. Every concurrent path is now also covered by the -race CI job added in v1.14.1.