Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max_entries of flow_directions map sets from configuration #959

Merged
merged 2 commits into from
Jun 22, 2024

Conversation

bareckidarek
Copy link
Contributor

The flow_directions map with hardcoded max_entries as 1 << 24 needs to lock over 2GB of memory.

sudo bpftool map show name flow_directions
563: lru_hash  name flow_directions  flags 0x0
	key 43B  value 1B  max_entries 16777216  memlock 2013267008B
	btf_id 664

This PR sets max entries from user configuration as for aggregate_flows. With a default value (5000) needs about 650KB.

sudo bpftool map show name flow_directions
556: lru_hash  name flow_directions  flags 0x0
	key 43B  value 1B  max_entries 5000  memlock 652160B
	btf_id 656

The key flow_id is pretty heavy (43B), and having it readable in the flow_directions map is unnecessary. I analysed if there is a better key to use, but found nothing yet.

@codecov-commenter
Copy link

codecov-commenter commented Jun 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.43%. Comparing base (d7d75a1) to head (9f28c6b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #959      +/-   ##
==========================================
+ Coverage   71.45%   79.43%   +7.98%     
==========================================
  Files         130      131       +1     
  Lines       10319    10330      +11     
==========================================
+ Hits         7373     8206     +833     
+ Misses       2314     1603     -711     
+ Partials      632      521     -111     
Flag Coverage Δ
integration-test 54.31% <100.00%> (+0.02%) ⬆️
k8s-integration-test 58.05% <100.00%> (-0.25%) ⬇️
oats-test 35.94% <0.00%> (-0.01%) ⬇️
unittests 47.58% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@grcevski grcevski left a comment

Choose a reason for hiding this comment

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

LGTM! Nice catch!

@grcevski grcevski merged commit 3a59841 into grafana:main Jun 22, 2024
6 checks passed
@grcevski
Copy link
Contributor

Thanks again @bareckidarek !

mattdurham pushed a commit to mattdurham/beyla that referenced this pull request Jan 22, 2025
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