Skip to content

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

Merged
cfc4n merged 2 commits into
masterfrom
custom-mapsize
Dec 2, 2023
Merged

user: custom mapSize flag. improve memory usage #433 .#435
cfc4n merged 2 commits into
masterfrom
custom-mapsize

Conversation

@cfc4n
Copy link
Copy Markdown
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
Copy Markdown
Member Author

cfc4n commented Dec 2, 2023

@h0x0er PTAL.

Copy link
Copy Markdown
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
Copy Markdown
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.

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