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

feat: agent - eBPF Add delay threshold check for push period #7607

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

yinjiping
Copy link
Contributor

@yinjiping yinjiping commented Jul 30, 2024

eBPF utilizes perf event's periodic events to push all data residing in the kernel cache. We have set this to push data from the kernel buffer every 10 milliseconds. This periodic event is implemented using the kernel's high-resolution timer (hrtimer), which triggers a timer interrupt when the specified time elapses. However, in practice, this timer does not always trigger interrupts precisely every 10 milliseconds to execute the eBPF program. This discrepancy occurs because timer interrupts may be masked off during certain operations, such as when interrupts are disabled during locking operations. Therefore, the timer may trigger interrupts after the expected time, resulting in latency for periodic events.

The system call phase will check the time delay of the push period, and if it exceeds this threshold, the data will be pushed immediately. From the tests, the maximum delay is approximately in the range of 30 to 60 milliseconds. Therefore, it is appropriate to set the threshold(PERIODIC_PUSH_DELAY_THRESHOLD_NS) for the system call phase check to 60 milliseconds.

This PR is for:

  • Agent

Affected branches

  • main
  • v6.5

eBPF utilizes perf event's periodic events to push all data residing in the kernel
cache. We have set this to push data from the kernel buffer every 10 milliseconds.
This periodic event is implemented using the kernel's high-resolution timer (hrtimer),
which triggers a timer interrupt when the specified time elapses. However, in practice,
this timer does not always trigger interrupts precisely every 10 milliseconds to execute
the eBPF program. This discrepancy occurs because timer interrupts may be masked off
during certain operations, such as when interrupts are disabled during locking operations.
Therefore, the timer may trigger interrupts after the expected time, resulting in latency
for periodic events.

The system call phase will check the time delay of the push period, and if it exceeds this
threshold, the data will be pushed immediately. From the tests, the maximum delay is
approximately in the range of 30 to 60 milliseconds. Therefore, it is appropriate to set the
threshold(`PERIODIC_PUSH_DELAY_THRESHOLD_NS`) for the system call phase check to 60 milliseconds.
@yinjiping yinjiping requested a review from sharang July 30, 2024 00:39
@yinjiping yinjiping enabled auto-merge (squash) July 30, 2024 00:48
@yinjiping yinjiping merged commit 344672f into main Jul 30, 2024
8 checks passed
@yinjiping yinjiping deleted the add_delay_threshold_main branch July 30, 2024 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants