Home > Net >  Does one App Service Plan instance with an Azure Function App process only one message session at a
Does one App Service Plan instance with an Azure Function App process only one message session at a

Time:11-26

I was reading this article about one Azure Function App instance will only process one message session at a time. So if we look at an App Service Plan with an Azure function app, that still represents one instance. If that is the case, if we had three different message sessions, we need to scale out three app service plan to create three instance of that azure function app to process those message sessions.

enter image description here

But my assumption may not be correct. When I talk to my coworker, we set our App Service plan's auto-scale to scale out only one instance manually. It's strange cause we see the different message session data are processed in parallel with that one App Service Plan instance based on the sync timestamp. How is this possible? Maybe a single instance of an App Service Plan can have multiple instances of its app?

enter image description here

I got lots of my reading from this the message session documentation and dev.to article

enter image description here

CodePudding user response:

A single compute instance (function in your case) can handle more than a single session. By default, the concurrency on sessions (the number of sessions that can be handled simultaneously) is set to 8. The order is preserved within each session though, so messages per session are delivered in the right order. Your code has to handle the fact that the same code is invoked for different sessions and handle it accordingly. If the code cannot do that, it has to handle sessions serially, reducing the number of concurrent sessions to 1 by changing the default in host.json.

  • Related