Skip to content

feat(events-export): EXM - the destination policy, measured (V403) - #392

Merged
randomizedcoder merged 1 commit into
mainfrom
goip/events-export-exm
Dec 5, 2026
Merged

randomizedcoder merged 1 commit into
mainfrom
goip/events-export-exm

Conversation

@randomizedcoder

Copy link
Copy Markdown
Owner

What

Tier EXM of the events export plan (PR #391): the destination policy's constants, sized from the committed event corpora — measured, not copied from the record path (§14's own rule) — and the test that pins the measured shape.

The measurement

TestEventsExportPolicyInputs (pkg/xtcpnl) walks the 7.1.4 oneshot boot window (five pcaps; the base pcap the union of the four family splits, 355 = 66+125+44+120) and the 66 workbench ev rows at both iproute2 versions, pinning: events, datagrams, per-event body sizes, the peak 100 ms and 1 s windows, and the quiet gaps.

The finding that reshaped the tier: one notification per datagram — every corpus, both kernel eras, every family (max events per datagram = 1, asserted over all 71 pcaps). The plan's premise that the kernel batches notifications into one recvmsg is falsified; the flush policy is the batching. The plan text is amended in this PR.

The numbers: the boot flood peaks at 56 events in 100 ms (60 in the worst second); a churn row's whole window peaks at 17; the quiet gaps run to 16.69 s; the event bodies run 40 bytes to 1548, median 40–116.

The constants (pkg/xtcp/events_export_policy.go)

Constant Value Why
EventsFlushIntervalCst 1 s the locality consumer's own chosen latency (the §13 close's "within a 1s debounce"); a lone event waits at most this, floods never reach it
EventsFlushThresholdRowsCst 64 above the 56-per-100 ms boot peak, ~4× the churn rows' worst window
EventsFlushThresholdBytesCst 64 KiB ~41 of the widest rows; the record path's rows-primary/bytes-secondary pair

The queue needs no events-specific depth: the destination default (16 envelopes) holds over 1.5 s of the measured worst flood.

Notes

  • The test's walk is manual, not WalkNlMsgsHdr — the latter's seq filter drops exactly the userspace-caused notifications (IsRtnetlinkNotification's documented trap). A zero nlmsghdr is end-of-datagram padding (the oneshot zero-pads its records — base pcap record 515).
  • The crafted monitor files carry no timestamps — they are EXP's round-trip inputs, not this measurement's.
  • The host's io_uring and write-timeout tests flickered under load 33–35 through this tier; the interleaved A/B run fails at main and passes with this change in the same minute, and three consecutive full-package runs went green as the load dropped.

Gates

Both full suites, vet both modes, gofmt, lint-baseline (the prealloc findings fixed in code), test-goip-docs, netlink-audit, nix-fmt — green.

🤖 Generated with pi

Tier EXM of the events export plan (docs/netlink/events-export.md): the
flush constants sized from the committed event corpora, and the test that
pins the measured shape.

TestEventsExportPolicyInputs (pkg/xtcpnl) walks the 7.1.4 oneshot boot
window (five pcaps; the base pcap the union of the four family splits,
355 = 66+125+44+120) and the 66 workbench ev rows at both iproute2
versions, and pins: events, datagrams, the per-event body sizes, the peak
100 ms and 1 s windows, and the quiet gaps.

The finding that reshaped the tier: one notification per datagram - every
corpus, both kernel eras, every family (max events per datagram = 1,
asserted over all 71 pcaps). The plan's premise that the kernel batches
notifications into one recvmsg is falsified; the flush policy is the
batching. The plan text is amended in the same commit.

The numbers: the boot flood peaks at 56 events in 100 ms (60 in the worst
second); a churn row's whole window peaks at 17; the quiet gaps run to
16.69 s; the event bodies run 40 bytes to 1548, median 40-116.

The constants (pkg/xtcp/events_export_policy.go):
- EventsFlushIntervalCst = 1 s - the locality consumer's own chosen
  latency (the 13 close's "within a 1s debounce"); a lone event waits at
  most this, and the floods never reach it (the rows cap fires first).
- EventsFlushThresholdRowsCst = 64 - above the 56-per-100 ms boot peak,
  ~4x the churn rows' worst window.
- EventsFlushThresholdBytesCst = 64 KiB - ~41 of the widest rows; the
  record path's rows-primary/bytes-secondary pair.
The queue needs no events-specific depth: the destination default (16
envelopes) holds over 1.5 s of the measured worst flood.

Notes: the test's walk is manual, not WalkNlMsgsHdr, because the latter's
seq filter drops exactly the userspace-caused notifications
(IsRtnetlinkNotification's documented trap); a zero nlmsghdr is
end-of-datagram padding (the oneshot zero-pads its records - base pcap
record 515). The crafted monitor files carry no timestamps, so they are
EXP's round-trip inputs, not this measurement's.

Gates: both full suites, vet both modes, gofmt, lint-baseline,
test-goip-docs, netlink-audit, nix-fmt. The host's io_uring and
write-timeout tests flickered under load 33-35 through this tier; the
interleaved A/B run fails at main and passes with this change in the same
minute, and three consecutive full-package runs are green as the load
dropped.

Next free evidence: V404.

🤖 Generated with [pi](https://github.com/badlogic/pi-mono)
@randomizedcoder
randomizedcoder merged commit 53ce534 into main Dec 5, 2026
1 check passed
@randomizedcoder
randomizedcoder deleted the goip/events-export-exm branch December 5, 2026 06:12
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