Azure Function Apps scalability metrics and terminology for Premium tier

57 views Asked by At

I'm trying to better understand the scalability behavior of my Premium function apps but I'm confused regarding terminology. Specifically I was trying to understand how many "servers" and how many "containers" of my app are running, but I can't be sure what these metrics precisely are:

  • AppRoleInstance
  • HostInstanceId
  • ProcessId

At first I thought a "Host" would be close to a VM and an "Instance" would be close to a container, but according to what I see that might be actually the other way around. And the dcount of ProcessId varies between 1 & 2 on a Always Available Function App with minimum 3 so I can't really understand what this process-id is. The AppRoleInstance and the HostInstanceId are matching most of the time except for some "host" spikes. For reference the query I'm using is similar to this:

AppTraces
| where AppRoleName = <function-app-name>
| summarize
    dcount(tostring(AppRoleInstance)),
    dcount(tostring(Properties.HostInstanceId)),
    dcount(tostring(Properties.ProcessId))
  by bin(TimeGenerated, 1h)
| render timechart
1

There are 1 answers

5
Ikhtesam Afrin On

And the dcount of ProcessId varies between 1 & 2 on a Always Available Function App with minimum 3 so I can't really understand what this process-id is.

Process Id gets assigned in Kudu site as soon as host is initiated for a function.

  • You can verify the same by navigating to Advanced Tools.

enter image description here

  • w3wp.exe handler gets activated when the function gets triggered and it stays active as long as that job host is active.

enter image description here

enter image description here

  • If the function app is idle for 20mins then the Job host stops and you will no longer see w3wp.exe.

enter image description here

enter image description here

  • When you will trigger the function or any activity is detected then a new host will be initialized with a new process id.

enter image description here

enter image description here

enter image description here

  • AppRoleInstance represents the number of Function App instances running at a time and each instance acts as a container which is running in a server.
  • HostInstanceId represents number of servers hosting for your function app.
  • Process Id represents the number of processes running in a container. In a Function App, each container can have a single process but if you are using Always On hosting plan then you can see multiple processes running.