Azure / Azure-Functions

1.11k stars 196 forks source link

[Premium] Max pre-warmed instances #1401

Open BenjaBobs opened 4 years ago

BenjaBobs commented 4 years ago

Describe the bug When configuring the pre-warmed instance count of the elastic scale, it cannot have values >10. I get the following error message: PreWarmedInstanceCount must be greater than zero and less than 10.

To Reproduce

PATCH https://management.azure.com/subscriptions/<subscription>/resourceGroups/<resourceGroup>/providers/Microsoft.Web/sites/<functionsApp>/config/web?api-version=2018-11-01
Authorization: <bearer token>
Content-Type: application/json

{
    "id": "/<subscription>/resourceGroups/<resourceGroup>/providers/Microsoft.Web/sites/<functionsApp>/config/web",
    "name": "<functionsApp>",
    "type": "Microsoft.Web/sites/config",
    "location": "<location>",
    "properties": {
        "reservedInstanceCount": 11,
        "functionsRuntimeScaleMonitoringEnabled": false
    }
}

Or go to Functions App -> Platform Feature -> Scale-Out and set the slider to 11 and click save.

Expected behavior It sets the value to 11.

jeffhollan commented 4 years ago

To confirm here when you are using the Scale-Out menu are you changing the "max instance" count or the "preWarmedInstance" count? A screenshot may help

BenjaBobs commented 4 years ago

Prewarmed instances. The maximum (or burst, if you will) is set to 20.

I assume the prewarmed instance count is supposed to be able to at least have the same value as the minimum instance count, right? Otherwise I think I have misunderstood the whole concept.

EDIT: I also had my minimum instance count set to 20.

jeffhollan commented 4 years ago

Yes you are correct. The only thing to make sure you also expect is by setting pre-warmed to 11 it means even if no events are coming it we will scale out to 11 instances for your app and run them on all of them. That's a lot of prewarmed - I wondered if we actually did set a limit of 10 for now, @alexkarcher-msft could confirm, but wanted to make sure I understood if you really want 11 instances buffered on idle and during scale

BenjaBobs commented 4 years ago

I'll explain my use case. I'm doing a lot of burst computing. The scale out algorithm is not aggressive enough for my use case, as I basically want full power until the work is done, and then the minimum power allocated.

After checking the portal and testing, I found that increasing the minimum instance count, and the prewarmed instance count allowed me to get the compute on demand, and turn it down afterwards.

So essentially, I'm raising minimum instance count and prewarmed instance count before the work, and then lowering it to the minimum of 1 after the work. I would like to increase the amount to more than 10 instances. 😄

BenjaBobs commented 4 years ago

@jeffhollan Is there any update for this? I need a lot of computing power to be available, and would like to know if this is something that is being investigated, or if I should find another solution than scaling up durable functions, such as just having multiple plans instead of a single plan that is scaled out.

BenjaBobs commented 4 years ago

Any news on this?

BenjaBobs commented 4 years ago

Any update?