bpftime icon indicating copy to clipboard operation
bpftime copied to clipboard

[Query] Configurable parameters in bpftime for uprobes ( uprobe Scale test)

Open nalreddy opened this issue 4 months ago • 3 comments

Describe the bug We are working on optimizing our product by using bpftime to reduce uprobes overhead. During this process, we identified a few hardcoded values and configuration variables that affect performance.

Our use case involves attaching a large number of uprobes—around 3,000 or more. we are benchmarking using https://github.com/ls1mardyn/ls1-mardyn. There is huge amount of data pushed to ring buffer.

Currently, we are modifying the following parameters:

DEFAULT_MAX_FD (defined in the code): Is it possible to make this value configurable via a feature flag or configuration option?

BPFTIME_SHM_MEMORY_MB (set at LD_PRELOAD time): Is it sufficient to set this only on the server, or do we also need to configure it on the agent? My understanding is that setting it once should be enough since it refers to the same shared memory segment. For example: sudo BPFTIME_SHM_MEMORY_MB=1024 LD_PRELOAD=build/runtime/syscall-server/libbpftime-syscall-server.so

Additional questions:

How does this shared memory size impact BPF programs, particularly those using ring buffers and hash maps?

Does a smaller shared memory size cause performance degradation?

What is the default value? Is it 20MB?

How should we determine the appropriate shared memory size for our use case?

Are there any other configuration parameters that should be adjusted for performance tuning? @yunwei37

nalreddy avatar Aug 05 '25 09:08 nalreddy

Are there any other configuration parameters that should be adjusted for performance tuning? @yunwei37

nalreddy avatar Aug 05 '25 09:08 nalreddy

There are several configs to improve the performance of bpftime:

yunwei37 avatar Aug 23 '25 13:08 yunwei37

https://github.com/eunomia-bpf/bpftime/pull/438

DEFAULT_MAX_FD is configuable after this PR.

yunwei37 avatar Aug 23 '25 14:08 yunwei37