Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactor: update packet capture to use 'afpacket' interface #7931

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

smira
Copy link
Member

@smira smira commented Nov 7, 2023

First of all, this interface is way more performant than pcap interface. It is Linux-specific, but we don't care in Talos Linux :)

Second, this drop dependency of machined on gopacket/layers package, which has huge issues with memory allocations and startup time.

This cuts around 20MiB of process RSS for all Talos processes. (talosctl still requires this gopacket/layers library for decoding packets).

Fixes #7880

First of all, this interface is way more performant than `pcap`
interface. It is Linux-specific, but we don't care in Talos Linux :)

Second, this drop dependency of `machined` on `gopacket/layers` package,
which has huge issues with memory allocations and startup time.

This cuts around 20MiB of process RSS for all Talos processes.
(`talosctl` still requires this `gopacket/layers` library for decoding
packets).

Fixes siderolabs#7880

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
@smira smira added this to the v1.6 milestone Nov 7, 2023
// For those that care, we currently write v2.4 files with nanosecond
// or microsecond timestamp resolution and little-endian encoding.
type Writer struct {
w io.Writer
Copy link
Member Author

Choose a reason for hiding this comment

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

that's stripped down version from gopacket which has no dependency on gopacket/layers

@smira
Copy link
Member Author

smira commented Nov 7, 2023

/m

@talos-bot talos-bot merged commit 6f3cd05 into siderolabs:main Nov 7, 2023
18 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reimplement packet capture in machined
3 participants