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

KEDA using Azure Service Bus - scaling down criteria #557

Open
ronlhayes opened this issue Jan 11, 2023 · 3 comments
Open

KEDA using Azure Service Bus - scaling down criteria #557

ronlhayes opened this issue Jan 11, 2023 · 3 comments
Labels
documentation Improvements or additions to documentation Needs: triage 🔍 Pending a first pass to read, tag, and assign question Further information is requested Scale related to scaling behavior

Comments

@ronlhayes
Copy link

This is more of a question than an issue. I have a .Net 6 service that uses Azure Service Bus (via MassTransit) that I would like to port to an Azure Container App. The consumer can take anywhere from 20-30 seconds up to 30 minutes to process a single message. Setting up KEDA to scale up using a message count of 1 should create a new replica for each message up to 30. My concern is how KEDA decides when to scale down a replica. What criteria is used? CPU usage? A fixed timeout? Thanks in advance for the help.

@ghost ghost added the Needs: triage 🔍 Pending a first pass to read, tag, and assign label Jan 11, 2023
@tomkerkhove
Copy link
Member

KEDA will start scaling in (not down) when the queue is empty and start killing instances.

It looks like you are doing "long-running" processing for which ScaledJobs is built; which is tracked in #526

@ronlhayes
Copy link
Author

ronlhayes commented Jan 12, 2023

Yes, that sounds like a better choice. For future reference, when using the Azure Service Bus (ASB) scaler is there an assumed timeout for each instance when scaling in (killing instances). For example 20 messages arrive in a ASB queue and the scaler is set to create a new instance for every 1 message. Would 20 instances get created? Assuming each takes 5-10 seconds to complete, once the queue count reaches 0, does the scaler use the start time of each instance and have a defined cool down before killing? If so, what is that cool down/timeout?

Regarding the ScaledJob scaler. Assuming I use a ASB trigger and have the same scenario as above. Would the scaler create 20 job instances? Each job would read a single ASB message, complete the associated work, remove the ASB message, and then exit? Once the message count reaches the scaler would scale in using the pollingInterval and remove jobs based on the successful/failed job limits? How does a job indicate success or failure when exiting?

@SophCarp SophCarp added documentation Improvements or additions to documentation question Further information is requested Scale related to scaling behavior labels Jan 13, 2023
@ghost
Copy link

ghost commented Sep 8, 2023

+1, we are having the similar issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Needs: triage 🔍 Pending a first pass to read, tag, and assign question Further information is requested Scale related to scaling behavior
Projects
None yet
Development

No branches or pull requests

3 participants