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

worker: run doWork at fixed rate #506

Closed
wants to merge 1 commit into from

Conversation

AlexanderYastrebov
Copy link
Member

Currently controller waits for pollingInterval after each doWork run that takes W time long.
Work rate and metrics counter change rate is therefore equal to 1 / (pollingInterval + W)
which makes it hard to configure alerts based on the counter change rate thresholds due to unknown W.

This change runs controller work cycle at fixed rate of 1 / pollingInterval.

For the existing deployments the side effect would be reduced work cycle and increased API request rates,
e.g. for W of 15s and default pollingInterval of 30s the work cycle is reduced from 45s to 30s (-33%).

Signed-off-by: Alexander Yastrebov alexander.yastrebov@zalando.de

Currently controller waits for `pollingInterval` after each `doWork` run that takes `W` time long.
Work rate and metrics counter change rate is therefore equal to `1 / (pollingInterval + W)`
which makes it hard to configure alerts based on the counter change rate thresholds due to unknown `W`.

This change runs controller work cycle at fixed rate of `1 / pollingInterval`.

For the existing deployments the side effect would be reduced work cycle and increased API request rates,
e.g. for `W` of 15s and default `pollingInterval` of 30s the work cycle is reduced from 45s to 30s (-33%).

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
@AlexanderYastrebov
Copy link
Member Author

Also if W > pollingInterval then controller would continuously run doWork without a delay

@AlexanderYastrebov AlexanderYastrebov marked this pull request as draft May 10, 2022 11:56
@mikkeloscar
Copy link
Collaborator

👍

@AlexanderYastrebov
Copy link
Member Author

which makes it hard to configure alerts based on the counter change rate thresholds due to unknown

It is better to configure absolute rate thresholds that would not depend on the controller work cycle duration at all.

@AlexanderYastrebov AlexanderYastrebov deleted the fix-polling-rate branch May 10, 2022 13:34
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.

None yet

2 participants