-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
eCapture consuming lot of memory #433
Comments
This calculation is inaccurate. It's best to only look at the resource usage of eCapture. For example, |
@cfc4n , I am investigating the issue. I will keep you updated. |
Following are some details
https://github.com/cilium/ebpf/blob/f0d238d1934f15fe8c5ef8755337be11bbc114e9/perf/ring.go#L25-L49 Calculations For my machine
Almost 1GB of RAM fyi @cfc4n |
Indeed, as you said, eCapture occupies a relatively large amount of memory.
Currently, eCapture supports three libraries: openssl\nss\nspr; however, openssl has the highest usage and supports the most mature library compared to the other two which are more niche. I plan to default close those two modules or create a new subcommand for separate support. Do you have any better ideas? |
Regarding BufferSizeOfEbpfMap
I agree with this, but I think setting it to I checked the tetragon implementation, I noticed following things; So, I think we should do similar things,
How are your thoughts on this ? Regarding per CPU types map performanceI am having a little doubt about the performance of per-cpu-buffers
Disabling unnecessary modules by default seems good idea fyi @cfc4n |
Thank you for your suggestion. |
I will submit another PR for the custom good night. |
Thanks @cfc4n . Good Night 🌃 |
used `--map-size` to set mapSize perCPU in cli. default:10240KB, Signed-off-by: cfc4n <[email protected]>
fixed at #435 Terminal 1sudo 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 2sudo bin/ecapture tls and , openssl module create 3 ebpf maps. {
Name: "tls_events",
},
{
Name: "connect_events",
},
{
Name: "mastersecret_events",
},
all eBPF maps used memory = 2 * 5 * 3 = 30MB. As expected. |
used `--map-size` to set mapSize perCPU in cli. default:10240KB, Signed-off-by: cfc4n <[email protected]>
Describe the bug
eCapture is consuming huge amount of memory.
To Reproduce
Note: Output of command
free -h
may vary.Expected behaviour
eCapture shouldn't consume that much memory.
The text was updated successfully, but these errors were encountered: