Azure-Functions icon indicating copy to clipboard operation
Azure-Functions copied to clipboard

Can I use WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT (and how)?

Open josh-endries opened this issue 9 years ago • 13 comments

I know about the WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT application setting, but I haven't found clear documentation on if/how I can make use of it. This page says it's a "preview feature":

https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings

Does this mean I need to do anything additional to enable use of this app setting? I also noticed a "feature" setting; a delimited list of preview features. Does this mean I need to put some token into that setting to enable this setting?

I am interested in this because I would prefer to limit one function to a single instance and another function to four instances, in order to protect downstream resources for those two functions.

josh-endries avatar Oct 04 '17 12:10 josh-endries

There is slightly more documentation on this app setting at: https://github.com/Azure/azure-webjobs-sdk-script/wiki/Configuration-Settings

"Set a maximum number of instances that a function app can scale to. This limit is not yet fully supported - it does work to limit your scale out, but there are some cases where it might not be completely foolproof. We're working on improving this."

andynava avatar Oct 04 '17 15:10 andynava

Could setting this to '1' be used to limit a function to run as a singleton? That is, prevent parallell execution?

larserikfinholt avatar Oct 13 '17 11:10 larserikfinholt

That is exactly what I'm using it for. I haven't tested it yet though.

josh-endries avatar Oct 13 '17 12:10 josh-endries

Any more updates on this? At the moment it seems there is no way to limit the auto-scale behaviour of the consumption plan function, but this may work?

gorillapower avatar May 02 '18 14:05 gorillapower

there is a limit regarding consumed gb/s in the function app settings. maybe this could do the trick?

marxxxx avatar May 02 '18 16:05 marxxxx

Ah thank you, I did not see that before. This will help. For those wondering, the setting is currently in the Azure Portal under the 'Function app settings' screen.

gorillapower avatar May 04 '18 12:05 gorillapower

Has anyone successfully used WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT when using a Azure Function v2 Service Bus Topic triggeron a consumption plan?

I have not managed to make the Azure Function runtime spread the load on multiple instances? After feeding several thousand messages on the topic, I have not been able to record more than one server ip-address in our external Serilog --> Seq instance.

Have others experienced a different behavoir in a similar use case?

markusfoss avatar Aug 20 '18 10:08 markusfoss

@cgillum I remember a thread a while back regarding our plans for this. Can you update here then close?

ColbyTresness avatar Mar 13 '19 19:03 ColbyTresness

We have plans to replace this app setting with something more reliable and settable through portal and/or ARM. No specifics to share yet though other than we hope to have it available for Consumption plans sometime this calendar year.

cgillum avatar Mar 13 '19 20:03 cgillum

@cgillum Is there any update on this? Is limiting consumption plan parallelism feature still planned for this year? It's being a major problem for projects with limited-resource service (SQL DB or external service having request-limit per second)...

Does the setting work for Consumption Plan or not? (it's not clear from the discussion, I find contradictory information in the docs and on the web)

loomchild avatar Mar 11 '20 17:03 loomchild

@cgillum, do you have any updates since your last message over a year ago regarding an alternative for WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT?

iamalexmang avatar Jun 11 '20 09:06 iamalexmang

@cgillum

Also looking for an update on this, or at least more insight on current functionality with WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT. We have a Function app with both HttpTrigger and ServiceBusTrigger functions. We have WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT set to 1 in the hopes that the Service Bus queue messages are processed one at a time. This seems to work, but we have seen where an influx of HttpTrigger function calls will cause scaling to occur, increasing the instance count. If there service bus messages being processed at the same time, multiple messages are processed at a time (one by each instance.)

Is WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT not compatible with HttpTriggers? More insight on when/how this works would be appreciated.

SamNutkins avatar Jul 12 '20 14:07 SamNutkins