Skip to content
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

eBPF different improvements #13624

Merged
merged 6 commits into from
Sep 7, 2022
Merged

Conversation

thiagoftsm
Copy link
Contributor

@thiagoftsm thiagoftsm commented Sep 4, 2022

Summary

Fixes #13626

This PR is fixing the following issues:

  • Improve PID monitoring;
  • Remove errors when plugin runs on CentOS 7.9, because there was not tracepoint available for OOMkill to run there.
  • Fix count in netdata.ebpf_threads chart when legacy code is used.

and it also brings less CPU/Memory usage and libbpf 1.0.

Test Plan
  1. Compile this branch and start netdata.
  2. Wait few seconds to process runs and check that :
  • You are not having libbpf warnings: grep libbpf /var/log/netdata/error.log
  • Take a look at chart apps.cpu and verify that ebpf.plugin is lower or equal apps.plugin.
  • If you have bpftool installed, you can run bpftool map show | grep 10922 and verify that PID tables are not having more the default size 32768, if you do not have take a look in the table present at Additional information.
  • If you have a CentOS 7.9 VM, compile this branch and take a look that you won't have the OOMkill thread started, instead you will have the following warning:
2022-09-07 12:29:04: ebpf.plugin INFO  : EBPF OOMKILL : Disabling OOMKILL thread, because kernel does not have necessary tracepoints.
2022-09-07 12:29:05: ebpf.plugin INFO  : EBPF OOMKILL : thread with task id 1956 finished
Additional Information

This PR was tested on:

Linux Distribution kernel version BPFTOOL CPU chart Threads chart
Slackware Current CO-RE 5.19.6 slackware_5_19_bpftool.txt slackware_5_19_cpu.txt slackware_5_19_threads.txt
Slackware Current Legacy 5.19.6 slackware_5_19_legacy_bpftool.txt slackware_5_19_legacy_cpu.txt slackware_5_19_legacy_threads.txt
Ubuntu 22.04 5.15.0-33-generic ubuntu_5_15_bpftool.txt ubuntu_5_15_cpu.txt ubuntu_5_15_threads.txt
Alma 9 5.14.0-70.17.1.el9_0.x86_64 --- alma_5_14_cpu.txt alma_5_14_threads.txt
Debian 11 5.10.0-16-amd64 debian_5_10_bpftool.txt debian_5_10_cpu.txt debian_5_10_threads.txt
Slackware Current 5.4.210 slackware_5_4_legacy_bpftool.txt slackware_5_4_legacy_cpu.txt slackware_5_4_legacy_threads.txt
Alma 8.6 4.18.0-372.19.1.el8_6 alma_4_18_bpftool.txt alma_4_18_cpu.txt alma_4_18_threads.txt
Ubuntu 18.04 4.15.0-180 ubuntu_4_15_bpftool.txt ubuntu_4_15_cpu.txt ubuntu_4_15_threads.txt
CentOS 7.9 3.10.0-1160.71.1.el7.x86_64. centos_3_10_bpftool.txt centos_3_10_cpu.txt centos_3_10_threads.txt
For users: How does this change affect me? Describe the PR affects users: - Which area of Netdata is affected by the change? ebpf.plugin - Can they see the change or is it an under the hood? If they can see it, where? Yes, they can use `apps.cpu` to verify that plugin is using less resource. - How is the user impacted by the change? A plugin more stable and faster. - What are there any benefits of the change? A better plugin

@thiagoftsm thiagoftsm marked this pull request as draft September 4, 2022 22:05
@thiagoftsm thiagoftsm changed the title eBPF improve PID monitoring and reduce CPU/Memory usage eBPF different improvements Sep 4, 2022
@github-actions github-actions bot added area/collectors Everything related to data collection area/packaging Packaging and operating systems support collectors/ebpf labels Sep 4, 2022
@thiagoftsm thiagoftsm marked this pull request as ready for review September 7, 2022 12:33
@thiagoftsm thiagoftsm requested review from MrZammler and underhood and removed request for vkalintiris September 7, 2022 13:12
@vlvkobal
Copy link
Contributor

vlvkobal commented Sep 7, 2022

Fixes #13626

Fixes or probably fixes?

@thiagoftsm
Copy link
Contributor Author

Fixes #13626

Fixes or probably fixes?

Fixes, the tests are showing that ebpf.plugin is always using less resources than apps.

@thiagoftsm thiagoftsm merged commit 2cb23d5 into netdata:master Sep 7, 2022
@thiagoftsm thiagoftsm deleted the ebpf_last_step branch September 7, 2022 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collectors Everything related to data collection area/packaging Packaging and operating systems support collectors/ebpf
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: High %sys usage of eBPF plugin when all programs are turned off
3 participants