We have some code that is fairly CPU, RAM and I/O intensive (it creates lots of temporary files, decompresses, resizes and compresses images). We're trying to integrate this into a "serverless" web application, and seeing as our code only runs on Windows at the moment we're testing it on Azure Functions.
We've observed that our code runs considerably slower on Azure Functions than it does on my local workstation (Core i7-4790, 16GB RAM, SSD). For example, one typical workload gives us these timings:
Dev workstation: 2.47 sec
Azure Functions, "App Service" plan (S3 size): 10.59 sec
Azure Functions, "Consumption" plan: 15.96 sec
We've also found that on the "Consumption" plan, timings vary quite widely - one particular job gave us times varying between 112 and 153 seconds. The same job on the S3 "App Service" plan took between 117 and 119 seconds, and around 31 seconds on my workstation.
Timings on P3 were similar to S3, which is about what I expected as the CPU and RAM specs are the same.
So I have a few questions really:
Memory used by a function is measured by rounding up to the nearest 128 MB, up to the maximum memory size of 1,536 MB, with execution time calculated by rounding up to the nearest 1 ms. The minimum execution time and memory for a single function execution is 100 ms and 128 mb respectively.
Guaranteed for up to 60 minutes.
Azure functions are fast to execute because there is no large application, startup time, initialization, and other events fired before the code is executed. Azure functions' execution is triggered when an event is fired.
You can profile App Service app (including Function App) remotely, see this link. I used Kudu and it worked good.
Really depends on your targets. The timings that your quoted can be perfectly fine for some applications.
This seems to be too broad a question for SO.
A more FunctionApp-ish approach would be to try to break down your long-running function into smaller short-running functions, and thus break down and potentially parallelize the processing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With