fix correct initial poller count for autoscaler #1440
Merged
+56
−52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed?
pollerCountWithoutAutoscaling
Why?
Consider a case when autoscaler is enabled with 40 max, 10 initial, 2 min. We need to start 40 poller goroutines first and only allow 10 to pass initially.
This is achieved by starting 40
go bw.runPoller()
goroutines and setPollerPermit
to 10.The bug we have now is we only start 10 goroutines at the beginning so it just won't scale up.
How did you test it?
bench test with stable tasklist traffic.
Pollers are 2 intially with 20 instances with autoscaler enabled.
After scaling down 20 -> 10 and 10 -> 2. We saw the poller quota increased to cover the loss of hosts. Schedule to start latency is maintained.
Potential risks
Additional goroutines will be created but it's ok because we are already creating a max of 10k goroutines by default for sticky executions.