ScaledObject accurate scaling strategy #4412
|
Hello, Is there something analogous to the scalingStrategy:
strategy: "accurate"for Some more context on my issue: We have been using KEDA
This has worked OK, but over time the simulation performance has improved, and hence the cold start penalty of starting a new pod for every message has become a real pain point (end users are effectively the ones putting these messages on the queue from our UI, and watching progress bars fed by updates from the simulatsions via WebSockets etc.). So I am trying to improve the situation by running our simulations as The main issue now is that if we push 4 messages to the queue, 3 simulations starts "immediately", but the 4th one does not start until one of the previous ones are done. If pushing 10 messages to the queue, it scales out fine to e.g. 7 replicas (since the queueLength is very quickly reduced to 7 when the first 3 are deleted), but then the 3 last ones have to wait for the other replicas to be done processing, and ready to pick up a new message. All messages are processed "eventually" with this setup. This is not an issue we had with the I am not able to find a way to configure this with KEDA ScaledJobs/HPA. Am I missing something out? |
Replies: 2 comments 1 reply
|
Hi, One question, do you use deployment ony for having always some active pods in order to avoid cold starts? I ask because ScaledJob has |
|
Hello, Thanks for your reply @JorTurFer! The more I think of this issue, the more I realize that the main problem is our sequence of:
If we change it to:
...the queue length would reflect both unprocessed and ongoing messages, and the scaler would be able to scale out to 1 replica per message in parallel, which is what I want (and my intention on the original question). I see now that #4002 adds a fix to make this behave exactly the way I want (as long as I update the application code to stop deleting the messages before they are processed). Otherwise, there is no real way for KEDA/HPA to know the difference between a "busy" and an "idle" Pod when running in a Deployment like this, so I think there is no way for KEDA/HPA to know that the remaining messages in the queue are being processed by the running pods or not. Jobs, on the other hand, can be assumed to be busy until they complete and exit, so if we have more messages in the queue, KEDA should simply start more Jobs. Regarding your comment @JorTurFer:
Thanks for the suggestion, I didn't really think of that option. It can act a bit weird when deciding when to complete a job (e.g. "done polling for messages, nothing in queue" would no longer be a proper exit condition). Not necessarily a big deal, and possible to work around I guess. I might actually give this a shot, as it seems easier on short terms than rewriting the application code logic as described above 👍
Yes, this is the reason we went for However, our views on the simulation runs have changed a bit after setting up this, so some reasons we would prefer ScaledObjects instead now are (just listing in case it is of any interest for original question background/context and our KEDA end user perspective):
|
Hello,
Thanks for your reply @JorTurFer!
The more I think of this issue, the more I realize that the main problem is our sequence of:
If we change it to:
...the queue length would reflect both unprocessed and ongoing messages, and the scaler would be able to scale out to 1 replica per message in parallel, which is what I want (and my intention on the original question).
I see now that #4002 adds a fix to make this behave exactly the way I want (as long as I update the applicati…