-
We have a function which is being triggered off a Service Bus. There is a steady stream of messages coming into the queue; however, historically never enough to need more than one instance of the function running. A few months ago, our function app scaled out unexpectedly to ~60 instances and never scaled back in. We placed a max scale limit and it happened again. We'd like to know if there is a way to mitigate this from happening. We do not believe setting a max scale of 2 is appropriate as this would be counter intuitive to having consumption-based function apps. Does anyone have any additional ideas or experience with this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 18 replies
-
@JFolberth just for clarity, are you using Durable Functions in your project? |
Beta Was this translation helpful? Give feedback.
-
I wanted to add a little more context to this as I was part of the original issue/troubleshooting and working directly with @JFolberth. A change I made that seemed to produce more reliable scaling for our function was to grant 'Manage' rights for the trigger on the service bus. This stopped the function from immediately scaling out to ~65 instances. Before making that change, the scale out would happen even with with no messages or trigger executions. It would just scale out for no good reason and never scale back in. It ran well for awhile, maybe a few weeks, without scaling but then we had a scale out to ~10 instances (I had set the scale to max at 10 just incase) with basically no traffic and it didn't scale back in. Based on MS docs Listen rights should be enough, Manage rights will only cause difference in the sensitivity of scale controller's scale out/in behavior which is mentioned to be "more efficient" in official document. The Manage rights are supposed to just bring in one more scale in/out rule to the equation. From my experience, this is not the case. Without Manage, it will scale out and not back in. |
Beta Was this translation helpful? Give feedback.
I wanted to add a little more context to this as I was part of the original issue/troubleshooting and working directly with @JFolberth.
A change I made that seemed to produce more reliable scaling for our function was to grant 'Manage' rights for the trigger on the service bus. This stopped the function from immediately scaling out to ~65 instances. Before making that change, the scale out would happen even with with no messages or trigger executions. It would just scale out for no good reason and never scale back in.
It ran well for awhile, maybe a few weeks, without scaling but then we had a scale out to ~10 instances (I had set the scale to max at 10 just incase) with basically no traf…