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

controller: jitter requeue interval #1184

Merged
merged 3 commits into from
Aug 7, 2023
Merged

controller: jitter requeue interval #1184

merged 3 commits into from
Aug 7, 2023

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Aug 1, 2023

This adds a --interval-jitter-percentage flag to the controller to add a +/- percentage jitter to the interval defined in resources (defaults to 10%).

Effectively, this results in a reconcilation every 4.5 - 5.5 minutes for a resource with an interval of 5 minutes.

Main reason to add this change is to mitigate spikes in memory and CPU usage caused by many resources being configured with the same interval.

Supersedes #1057

xref: fluxcd/flux2#4120

@hiddeco hiddeco added the enhancement New feature or request label Aug 1, 2023
@hiddeco hiddeco marked this pull request as draft August 1, 2023 15:13
@hiddeco hiddeco mentioned this pull request Aug 1, 2023
4 tasks
Copy link
Member Author

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

This needs at least a merge and release of the pkg/runtime pull requests before it can be merged.

In addition, it may be wise to make some small changes to the documentation to highlight that the .spec.interval is now an approx setting.

@hiddeco hiddeco mentioned this pull request Aug 7, 2023
@hiddeco hiddeco marked this pull request as ready for review August 7, 2023 11:50
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @hiddeco 🎖️

Copy link
Contributor

@darkowlzz darkowlzz left a comment

Choose a reason for hiding this comment

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

Tried it and works as advertised. Different requeue after values every reconciliation and no jitter with --interval-jitter-percentage=0 flag.
LGTM!

This adds a `--interval-jitter-percentage` flag to the controller to
add a +/- percentage jitter to the interval defined in resources
(defaults to 10%).

Effectively, this results in a reconcilation every 4.5 - 5.5 minutes
for a resource with an interval of 5 minutes.

Main reason to add this change is to mitigate spikes in memory and
CPU usage caused by many resources being configured with the same
interval.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
@hiddeco hiddeco merged commit 727d62b into main Aug 7, 2023
10 checks passed
@hiddeco hiddeco deleted the jitter branch August 7, 2023 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants