-
Notifications
You must be signed in to change notification settings - Fork 111
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
Reuse BPF programs in multi-process mode #471
Conversation
// tracers returns Tracer implementer for each discovered eBPF traceable source: GRPC, HTTP... | ||
func (pt *ProcessTracer) tracers() ([]Tracer, error) { | ||
loadMux.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must be locked to force loading of eBPF programs one by one, otherwise we can't properly share the pinned maps, once in a while I get file already exists.
Here's some before and after data from running I'm running below 3 HTTPS services, Rust (shared libssl), Node (vendored libssl), Python (shared libssl), with the following configuration: discovery:
services:
- namespace: multi-k
name: rust-service
open_ports: 8490
- namespace: multi-k
name: python-service
open_ports: 8083
- namespace: multi-k
name: nodejs-service
open_ports: 3033 Before (61 probes):
After (19 probes):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What a huge change! Maybe some parts could be refactored to reduce a bit of complexity of the usage of global variables, but I'd need to experiment a bit first 😅.
Once the integration tests are fixed, it's LGTM to merge and we can refine later.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #471 +/- ##
===========================================
- Coverage 77.17% 40.42% -36.75%
===========================================
Files 65 65
Lines 5183 5170 -13
===========================================
- Hits 4000 2090 -1910
- Misses 962 2945 +1983
+ Partials 221 135 -86
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
In version 1 we load multiple versions of the same kprobes and uprobes, and use the map filtering by PID to eliminate duplicates. This PR fixes that, allowing for more shared maps and reducing probes loaded to the minimum required. We reuse the kprobes and the probes on libssl.
Closes #395
TODO: