Last week Microsoft announced that the go-live release of the Azure Functions 3.0 is now available, meaning it's out of preview and is usable in production.
Even though Functions 3.0 has been officially released, functions created in the Azure portal will still use Functions 2.0 by default. Functions 3.0 is set to become the default as soon as January 2020, once some tooling updates are made.
Should You Upgrade to Functions 3.0?
Functions 3.0 drops support for node 8 functions and introduces support for .NET core 3.1 and node 12 functions. The .NET core 3.1 update is a much-needed one, as Functions 2.x only allows .NET functions up to .NET Core 2.2, the support of which ends later this month (December 23).
That being said, neither Functions 1.x nor Functions 2.x are currently being deprecated. Functions 3.0 is highly backward compatible with Functions 2.x, migrating most functions should be straightforward (except for node functions that require some notable source code adjustments).
This means that if you aren't dependent on a specific node or .NET version, you can use either version of Azure Functions. To help you choose, we've benchmarked the invocation overhead in both versions on FaaStest.com.
Benchmarking Invocation Overhead
We used the IncreasingLoadLvl1 test to benchmark the invocation overhead of the same functions using both Azure Functions 2.x and Azure Functions 3.x. This test deploys a function that sleeps for 50ms before returning. It gradually invokes more concurrent instances of this function, from 1 invocation to 40 concurrent invocations by the end of the test. The test waits for 1 second between each burst of concurrent invocations.
Python functions see the most drastic invocation overhead reduction in Azure Functions 3.0:
Using FaaStest's line view, we can see that in Azure Functions 2.0 the invocation overhead grew with the number of concurrent invocations:
There is also an invocation overhead improvement in node functions on Linux:
On the other hand, we can see a noticeable invocation overhead increase in .NET functions on Linux in Functions 3.0:
The rest of the functions tested had only slight differences in their invocation overheads between Azure Functions 2.x and Azure Functions 3.x:
Comparing Different Runtimes on Azure Functions 3.0
Interestingly, despite its improvement the Python function still has greater invocation overhead than most other functions in Azure Functions 3.0:
Azure Functions 3.0 is, indeed, a very exciting update. It allows using newer function runtimes and it brings some performance improvements, but it currently seems that .NET functions on Linux suffer from an increase in the Invocation Overhead.
Deciding to upgrade from Functions 2.0 to 3.0 is not an easy decision, but Faastest.com might bring to light performance differences that will help you make a better choice.