-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Jobs don't scale properly based on target value/replica count #801
Comments
if i am not mistaken this is same issue that i have experienced: |
Any progress here ? I am experiencing the same behavior. |
AFAIK we haven't made progress on this as we're working hard on 2.0. @zroubalik I presume this will be different in 2.0 now that they will be split, right? |
@tomkerkhove yes, but we should keep this issue open to track this particular problem, to be sure that it gets fixed in the v2 implementation. |
UP 👍 |
Fixed in v2 in #951 |
…e#801) Co-authored-by: Tom Kerkhove <kerkhove.tom@gmail.com>
So Jobs don't appear to scale at all according to
maxReplicaCount
andTargetAverageValue
I have this configuration:
Which produced these logs (with irrelevant fields removed):
Expected Behavior
Since the
QueueLength
is 10 andmaxReplicaCount
is 3, one would expect that 3 jobs would be created.Actual Behavior
Only 1 job is created (since it thinks that
MaxValue
is 1)Since there isn't a lot of docs on jobs, I did some digging in code which led me to these lines of code
keda/pkg/handler/scale_loop.go
Lines 72 to 77 in 1ec79ec
which are used to compute
maxValue
which is in turn used herekeda/pkg/handler/scale_loop.go
Line 99 in 1ec79ec
which leads to
keda/pkg/handler/scale_jobs.go
Lines 18 to 26 in 1ec79ec
and
effectiveMaxScale
is used to figure out how many jobs to create.Now lets take a look at how this actually get computed
In this scenario I don't have any jobs running (as per the logs), so
effectiveMaxScale
is essentially:since
runningJobCount
is 0given that the above call is formatted as
effectiveMaxScale
is justmaxValue
which we know to be the sum of all the metrics'TargetAverageValue
. Since I only have one scaler, the number of jobs created in this scenario will ALWAYS be set to the providedlistLength
which in this case is just 1.Now that would be no issue except the docs say this about
TargetAverageValue
:which means that if I have a
queueLength
of 10 (like the logs indicate), and aTargetAverageValue
of 1, I would expect 3 jobs to be run (since mymaxReplicaCount
is 3) yet only 1 does.In order to immediately combat this I attempted to bump up my
TargetAverageValue
to 3 and tested with a queue length of 1, but I ended up with this:Which instead incorrectly creates a job every time the trigger passes even though it shouldn.t need to. Essentially Jobs never scale appropriately, they end up being set to the
TargetAverageValue
and ignoremaxReplicaCount
Realistically, you just need to calculate the
maxValue
as a quotient ofmaxReplicaScale
andTargetAverageValue
somehow.Steps to Reproduce the Problem
Follow above configuration and push some things into the redis list
Specifications
The text was updated successfully, but these errors were encountered: