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

feature: only allow autoscaling in a direction once a full metric window has elapsed #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aaronkvanmeerten
Copy link
Member

No description provided.

@aaronkvanmeerten
Copy link
Member Author

Untested, intended for discussion before merging. This is meant to keep from autoscaling up or down repeatedly in a period, before a full metric window has elapsed. Currently we will autoscale again after the grace period TTL has elapsed.

if (desiredCount > group.scalingOptions.maxDesired) {
desiredCount = group.scalingOptions.maxDesired;
}
if (await this.instanceGroupManager.allowAutoscalingByDirection(group.name, 'up')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We want to be able to react fast especially to scaling up and this might alter this behaviour.

  • For example, let's say scaleUpPeriodsCount = 3, and scaleUpThreshold = 5. At time x, we might see the following metrics per period: 4, 3, 3. Which means we scale up.

  • We wait for gracePeriodTTLSec for the instances to come up and be operational and then we check again the new metrics window. But if the usage is high, the newly instances will be immediately used and the sliding window will become 3, 3, 2. Which means we should scale up again.

  • You change suggests we should not scale up then, but instead wait 2 more scalePeriod and only then take the decision. This might be too late.

If we do want to play with having the grace period larger, I would prefer to leave the choice of the grace period in the hands of the admin of the group. Maybe we should look into adding a configurable grace period per direction per group, and the admin can set it to the desired value, such as scaleUpPeriodsCount * group.scalingOptions.scalePeriod for up.

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