bpftime
bpftime copied to clipboard
[Query] Configurable parameters in bpftime for uprobes ( uprobe Scale test)
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
Are there any other configuration parameters that should be adjusted for performance tuning? @yunwei37
There are several configs to improve the performance of bpftime:
- Use JIT when running the eBPF program. The JIT will be enabled by default in the future after more tests. See documents/usage.md for more details.
- Compile with LTO enabled. See documents/build-and-test.md for more details.
- Use LLVM JIT instead of ubpf JIT. See documents/build-and-test.md for more details.
- Disable logs. See documents/usage.md for more details.
https://github.com/eunomia-bpf/bpftime/pull/438
DEFAULT_MAX_FD is configuable after this PR.