Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fetch all ip addresses in a single stdlib call#246

New issue

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

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
swiatekm merged 3 commits intomainfromfix/net-iface-ipadresses
Oct 29, 2024

Conversation

swiatekm
Copy link
Contributor

@swiatekmswiatekm commentedOct 29, 2024
edited
Loading

When fetching ip addresses for the host, we fetch all the network interfaces, and then ip addresses for each interface. The latter call is surprisingly expensive on unix, as it involves opening a netlink socket, sending a request for routing information, and receiving and parsing the response. If the host has a lot of network interfaces, this can eat surprising amounts of memory - I got in the order of 10 MB on a Kubernetes Node with 100 Pods. Seeelastic/elastic-agent#5835 (comment) for some heap profiles from elastic-agent.

Instead, get all the addresses in a single stdlib call. We don't actually care about which interface each ip address is attached to, we just want all of them.

I've tested this in the real world scenario discussed inelastic/elastic-agent#5835, not sure how to include a self-contained test in this repo.

@swiatekmswiatekm changed the titleFetch all ip addresses in a single stdlib call on LinuxFetch all ip addresses in a single stdlib callOct 29, 2024
@andrewkrohandrewkroh added the enhancementNew feature or request labelOct 29, 2024
@swiatekmswiatekm merged commit750e2c7 intomainOct 29, 2024
18 checks passed
@swiatekmswiatekm deleted the fix/net-iface-ipadresses branchOctober 29, 2024 17:06
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@andrewkrohandrewkrohandrewkroh approved these changes

Assignees
No one assigned
Labels
enhancementNew feature or request
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@swiatekm@andrewkroh

[8]ページ先頭

©2009-2025 Movatter.jp