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

Querying the auto-scaling formula #276

Open
clxseizetheday opened this issue Feb 18, 2022 · 4 comments
Open

Querying the auto-scaling formula #276

clxseizetheday opened this issue Feb 18, 2022 · 4 comments

Comments

@clxseizetheday
Copy link

clxseizetheday commented Feb 18, 2022

hello guys,
I am reading the document about the autoscaling of OpenFaas. In the chapter 'Autoscaling', https://docs.openfaas.com/architecture/autoscaling/#how-auto-scaling-works it gives a formula about the strategy of calculating the desire replics amount.

it says desired = current replicas * (current load / (target load per replica * current replicas))
however, the first current replicas in the formula and the current replicas in the denominator will always cancel out.
So how should I understand this formula?

Thanks

@clxseizetheday clxseizetheday changed the title Maybe something wrong with Maybe something wrong with autoscale's formula? Feb 18, 2022
@clxseizetheday
Copy link
Author

clxseizetheday commented Feb 18, 2022

In fact, if I cancel out the two current replicas in the formula, it will turn into desired = current load / target load per replica.
This new formula is easy to understand. In my opinion, current load will not change before and after the sacling, so just divide target load per replica by current load and then you get the desired replics, right? How does current replicas influence the origin formula?

@LucasRoesler
Copy link
Member

@alexellis I think it might be best for you to comment here, given your recent work on scaling

@alexellis
Copy link
Member

The formula should match that of Kubernetes HPAv2:

https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#algorithm-details

@alexellis
Copy link
Member

/set title: Querying the auto-scaling formula

@derek derek bot changed the title Maybe something wrong with autoscale's formula? Querying the auto-scaling formula May 26, 2022
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

No branches or pull requests

3 participants