Skip to content

perf(net): reduce node status collection allocations - #743

Merged
Patrick W. Healy (phealy) merged 1 commit into
phealy/auth-pod-bindingfrom
phealy/net-status-collection-efficiency
Sep 18, 2026
Merged

Patrick W. Healy (phealy) merged 1 commit into
phealy/auth-pod-bindingfrom
phealy/net-status-collection-efficiency

Conversation

@phealy

@phealy Patrick W. Healy (phealy) commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Production-only node status collection optimizations, stacked on #731. No simulator, e2e suite, new dependency, routing policy, or publication-interval changes are included.

Stack: #731 -> #743 (this PR) -> #744 (status transport/controller memory) -> #745 (health checks).

  • Build one read-only route-classification index per status snapshot and share it across IPv4/IPv6 annotations instead of rebuilding it for every next-hop.
  • Append BPF records into one output slice and reuse successful interface-name/MTU lookups within a collection.
  • Keep failed lookups retryable and rebuild caches for each collection so topology, interface, and MTU changes remain visible.
  • Add behavior, allocation, and benchmark coverage plus operational documentation.

Validation

  • Full cmd/unbounded-net-node tests passed on the current fix(net): validate OIDC pod bindings against informer caches #731 base.
  • Targeted race-enabled BPF/interface/route-classification tests passed.
  • Scoped make fmt, make lint (including actionlint), and node build passed.
  • Comparative microbenchmarks with 2,000 peers: route-classification allocation decreased from 796,457,192 to 2,411,367 B/op in this run.
  • The 2,000-entry BPF benchmark reduced repeated interface lookups from 2,000 to 1 and allocation from 1,094,891 to 742,591 B/op.

These are isolated benchmark comparisons, not a claim about whole-cluster RSS or CPU percentages. Original dirty simulator and optimization worktrees are preserved.

Build route classification once per snapshot, append BPF records into shared output, and cache successful interface resolution per collection without retaining stale topology.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d2243398-6c36-4c3d-969e-7ed7bfb5b459

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The optimizations preserve existing semantics and include focused behavioral and performance coverage.

Pull request overview

Optimizes node status collection allocations while preserving routing and refresh behavior.

Changes:

  • Reuses one route-classification index per snapshot.
  • Reuses BPF output storage and successful interface lookups.
  • Adds behavioral, allocation, benchmark, and operational coverage.
File summaries
File Description
docs/net/operations.md Documents collection caching behavior.
cmd/unbounded-net-node/route_annotations.go Shares route-classification data across address families.
cmd/unbounded-net-node/route_annotations_memory_test.go Tests route behavior and allocation bounds.
cmd/unbounded-net-node/bpf_status.go Reduces BPF collection allocations and interface lookups.
cmd/unbounded-net-node/bpf_status_test.go Tests BPF caching, output, and benchmarks.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@phealy
Patrick W. Healy (phealy) added this pull request to the merge queue Sep 18, 2026
Merged via the queue into main with commit 550fb89 Sep 18, 2026
35 of 37 checks passed
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.

3 participants