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

user: custom mapSize flag. improve memory usage #433 . #435

Merged
merged 2 commits into from
Dec 2, 2023
Merged

Conversation

cfc4n
Copy link
Member

@cfc4n cfc4n commented Dec 2, 2023

used --map-size to set mapSize perCPU in cli. default:10240KB,

used `--map-size` to set mapSize perCPU in cli. default:10240KB,

Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
@cfc4n cfc4n added enhancement New feature or request improve labels Dec 2, 2023
@cfc4n cfc4n linked an issue Dec 2, 2023 that may be closed by this pull request
@cfc4n
Copy link
Member Author

cfc4n commented Dec 2, 2023

@h0x0er PTAL.

Copy link
Contributor

@h0x0er h0x0er left a comment

Choose a reason for hiding this comment

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

@cfc4n , PR Looks Good To Me 🚀. Thanks for the enhancements

Set the default `--map-size` to 5120KB.

Signed-off-by: cfc4n <cfc4n.cs@gmail.com>
@cfc4n
Copy link
Member Author

cfc4n commented Dec 2, 2023

Terminal 1

sudo free -m
[sudo] password for cfc4n:
               total        used        free      shared  buff/cache   available
Mem:            3876         477         277           1        3121        3106
Swap:           3893           0        3893

#### exec ecapture at other terminal.
sudo free -m
               total        used        free      shared  buff/cache   available
Mem:            3876         513         240           1        3121        3069
Swap:           3893           0        3893

Terminal 2

sudo bin/ecapture tls

and , openssl module create 3 ebpf maps.

{
    Name: "tls_events",
},
{
    Name: "connect_events",
},
{
    Name: "mastersecret_events",
},
  • mapSizePerCPU = 5M
  • 2 CPUS
  • 3 eBPF maps

all eBPF maps used memory = 2 * 5 * 3 = 30MB.
now, eCapture used memory (include ebpf maps) = 513-477 ≈ 277-240 ≈ 36M .

As expected.

@cfc4n cfc4n merged commit 4625226 into master Dec 2, 2023
6 checks passed
@cfc4n cfc4n deleted the custom-mapsize branch December 2, 2023 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request improve
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eCapture consuming lot of memory
2 participants