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"
}
}
}
}