When we're talking about a performance of Azure Function
we must discuss them in a context of the following issues: high CPU
/ memory
consumption, port
/ outbound_socket
consumption, number of spawned_threads
/ pending requests
, etc.
There's one important thing you need to bear in mind: while creating a Function App a developer should keep in mind the fact that moving from Consumption Plan
to App Service Plan
(or vice-versa) is impossible once the function has created. But if he deletes the Function app and recreates it on the other type of hosting plan then that is possible for obvious reasons. A developer should design a function app in a way avoiding performing an intensive tasks taking high CPU and memory consumption, spawning large number of threads, opening large number of outbound socket connections, etc.
The best practises for improving performance of Azure Functions are:
- avoid long running functions
- use storage queues for cross function communication
- write functions to be stateless
- write defensive functions
- re-use connections to external resources whenever possible
- use async code and avoid blocking calls
Once the application usage gets past to these limits the processing rate of messages gets reduced and then the scale controller adds a new instance of a machine and the load gets distributed to keep up the processing rate. However, it takes about 10 seconds to add a new instance and then the load balancing of the events starts. However when the new instances are added then processing speeds up and within 20-30 minutes, the high load (10,000 requests) will be settled.
Conclusion
: Azure Functions' performance depends on a variety of factors.
Hope this helps.