You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use actual ready pods instead of observed pods for scaling rate #2994
The scaling rate should be the ratio of desired pods versus actual ready pods, instead of observed pods. Observed pods includes lameducked pods, which are terminating.
When switching to scraping metrics, we can't get the correct observed pods if we sample. We have to use actual ready pods from K8S API anyway.
Actual Behavior
The scaling rate is the ratio of desired pods versus observed pods.
where average_observed_revision_concurrency is from stats data, actual_ready_pods is from K8S API(informer), target_concurrency_per_pod and max_scaling_rate are from configuration.
In this way, we can get rid of observed_pods and make the logical cleaner.
What do we need the scaling rate for in the end? Do we need it only for rate-limiting?
Yes. Just a safety heuristic.
The scaling rate should be the ratio of desired pods versus actual ready pods, instead of observed pods. Observed pods includes lameducked pods, which are terminating.
This was previously accounted for by degrading the contribution of lameducked pods. Is this no longer the case?
I believe we also want this change for your scraping work, because we will never know the correct number of existing, ready pods by scraping if we sample. If so, that would be worth adding to the description.
I believe we also want this change for your scraping work, because we will never know the correct number of existing, ready pods by scraping if we sample. If so, that would be worth adding to the description.
Activity
yanweiguo commentedon Jan 25, 2019
cc @josephburnett @k4leung4 @markusthoemmes
markusthoemmes commentedon Jan 25, 2019
What do we need the scaling rate for in the end? Do we need it only for rate-limiting?
yanweiguo commentedon Jan 25, 2019
According to my knowledge to current scaling algorithm, the answer is yes.
yanweiguo commentedon Jan 26, 2019
The formulas to calculate the desired pods are
Let
scaling_rate = observed_concurrency_per_pod / target_concurrency_per_pod, thenSet a limitation for scaling rate, then
where
observed_concurrency_per_podandobserved_podsare from stats data,target_concurrency_per_podandmax_scaling_rateare from configuration.However, the rate limiting should apply to actual current ready pod count. I propose:
where
average_observed_revision_concurrencyis from stats data,actual_ready_podsis from K8S API(informer),target_concurrency_per_podandmax_scaling_rateare from configuration.In this way, we can get rid of
observed_podsand make the logical cleaner.josephburnett commentedon Jan 28, 2019
Yes. Just a safety heuristic.
This was previously accounted for by degrading the contribution of lameducked pods. Is this no longer the case?
I believe we also want this change for your scraping work, because we will never know the correct number of existing, ready pods by scraping if we sample. If so, that would be worth adding to the description.
yanweiguo commentedon Jan 28, 2019
Yes. Updated the description.