Skip to content

CA-409482: Using computed delay for RRD loop #6458

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

Merged
merged 1 commit into from
May 22, 2025

Conversation

BengangY
Copy link
Contributor

@BengangY BengangY commented May 8, 2025

RRD loop is executed each 5 seconds. It delays fixed 5 seconds between each loop. But the loop self also consumes time (The time consuming depends on CPU's count. If there are many CPUs, the time consuming may be hundreds milliseconds). This implementation leads RRD will take an offset after several loops. Then one of RRD data lose and a gap can be observed on XenCenter performance graph.

The solution is to use computed delay (timeslice - loop time consuming) instead of fixed delay.

@BengangY BengangY force-pushed the private/bengangy/CA-409482 branch from a289be7 to 35dcd13 Compare May 8, 2025 09:49
@robhoes robhoes requested a review from last-genius May 8, 2025 09:50
@last-genius
Copy link
Contributor

LGTM!

@lindig
Copy link
Contributor

lindig commented May 9, 2025

Can we updraft this?

@BengangY
Copy link
Contributor Author

BengangY commented May 9, 2025

Can we updraft this?

You mean 'undraft'? I'm making more testing for it. If it works well, I will undraft it.

@BengangY BengangY marked this pull request as ready for review May 12, 2025 02:41
@BengangY BengangY force-pushed the private/bengangy/CA-409482 branch from 35dcd13 to 3bc9fae Compare May 14, 2025 08:28
@BengangY BengangY force-pushed the private/bengangy/CA-409482 branch from 3bc9fae to c08ac31 Compare May 16, 2025 07:16
@BengangY BengangY force-pushed the private/bengangy/CA-409482 branch 2 times, most recently from c6f4781 to dac7a66 Compare May 21, 2025 09:27
Copy link
Member

@psafont psafont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think with Timer is both shorter, and easier to understand, let me know what you think

@BengangY BengangY force-pushed the private/bengangy/CA-409482 branch from dac7a66 to b0631f5 Compare May 21, 2025 14:34
Copy link
Member

@psafont psafont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good

RRD loop is executed each 5 seconds. It delays fixed 5 seconds between each
loop. But the loop self also consumes time (The time consuming depends on CPU's
count. If there are many CPUs, the time consuming may be hundreds milliseconds).
This implementation leads RRD will take an offset after several loops. Then one
of RRD data lose and a gap can be observed on XenCenter performance graph.

The solution is to use a fixed deadline as each iteration start time and to use
a computed delay (timeslice - loop time consuming) instead of fixed delay.

Signed-off-by: Bengang Yuan <[email protected]>
@BengangY BengangY force-pushed the private/bengangy/CA-409482 branch from b0631f5 to b947e1e Compare May 22, 2025 03:38
@BengangY BengangY added this pull request to the merge queue May 22, 2025
Merged via the queue into xapi-project:master with commit b91bba2 May 22, 2025
17 checks passed
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.

6 participants