cbs-1707 avatar image
0 Votes"
cbs-1707 asked vipullag-MSFT edited

Azure Function not scaling correctly

I have a Function App written in dotnet-isolated and running in Windows on Azure. In this Function I run an .exe file (using System.Diagnostics.Process), which takes roughly 1 minute to run. This .exe file also writes some output files which I then later read. So, it is heavy on both CPU usage and I/O. The rest of the function takes ~1 second to run.
My problem then occurs when I have multiple http requests coming in at once. When Azure schedules multiple of these requests on the same VM, then the running time of the .exe drastically increases. When the running time of the .exe then exceeds this 230 second mark Azure has set, it returns an error.

My question is then: Is there a way for me to force Azure to scale to more VM's, as the .exe can't run in parallel across the threads on the same VM?
I have tried with some different parameters in the host.json on Azure configuration, but they only seem to help a little.

My added Azure configuration:
FUNCTIONS_WORKER_PROCESS_COUNT: 2 (I've tried with 5 and 10, but they made it worse than the default value 2)

My host.json:

   "version": "2.0",
   "functionTimeout": "00:10:00",
   "extensions": {
     "durableTask": {
       "storageProvider": {
         "controlQueueBatchSize": 1,
         "controlQueueBufferThreshold": 1
     "http": {
       "maxConcurrentRequests": 20
   "logging": {
     "applicationInsights": {
       "samplingSettings": {
         "isEnabled": true,
         "excludedTypes": "Request"
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@cbs-1707 , Which plan/SKU the function is running?

I will be able to provide a proper answer once I get the answer

0 Votes 0 ·
cbs-1707 avatar image cbs-1707 MughundhanRaveendran-MSFT ·

The Function App is running on a consumption plan.

0 Votes 0 ·

0 Answers