Slow initial run of Azure functions

%3CLINGO-SUB%20id%3D%22lingo-sub-2435452%22%20slang%3D%22en-US%22%3ESlow%20initial%20run%20of%20Azure%20functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2435452%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20see%20very%20slow%20initial%20run%20of%20Azure%20functions%2C%20is%20there%20any%20way%20to%20improve%20this%3F%20For%20example%2C%20an%20event%20hub%20triggered%20function%20where%20no%20events%20have%20been%20sent%20for%20a%20number%20of%20hours.%20When%20the%20next%20event%20comes%20through%20the%20startup%20time%20of%20the%20function%20can%20be%20minutes%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

We see very slow initial run of Azure functions, is there any way to improve this? For example, an event hub triggered function where no events have been sent for a number of hours. When the next event comes through the startup time of the function can be minutes

2 Replies
The Azure Functions service has a scale controller component that monitors your event sources. When an event source goes idle for many hours, it will wait longer to poll your event source for new messages. Looks like this is happening here. There's not much you can do to control this behavior in the consumption plan. One possibility is to switch to the premium plan, but that might not be economical for an app that is not always in use.
Thanks for the explanation Anthony. The premium plan as you have said would not be cost effective for us but I believe if the service was processing events regularly it may not be much of an issue, which i think we can cope with.