question

TomGutzler-1570 avatar image
0 Votes"
TomGutzler-1570 asked PramodValavala-MSFT commented

Azure Functions Host Initializing over and over again

I'm seeing multiple "Initializing Host" messages per hour in app insights. I wonder if this is to be expected.

My functions are mainly queue triggered and I've configured batchSize = 1 in my host.json so I don't expect parallel execution.
There is one timer triggered function that does nothing. It fires every 9 minutes.

Host initialization happens even when there is no activity on the queues.
I'm running functions v3

azure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PramodValavala-MSFT avatar image
0 Votes"
PramodValavala-MSFT answered PramodValavala-MSFT commented

@TomGutzler-1570 While your batchSize is set to 1 and assuming you are running on the consumption tier, your function app could scale out to multiple instances causing the multiple logs. Also, when there is no activity, your function app would scale down to zero and a new message would trigger the function app to start up, again causing the log.

If you need to ensure your function app doesn't scale out beyond on a single instance, then you can limit the scale out as covered in the docs.


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks.
I thought that having the timer triggered function run every 9 minutes would prevent it from scaling in to zero.
I'll limit the scale out and keep an eye it.

0 Votes 0 ·

@PramodValavala-MSFT
To clear things up, I am on the consumption tier.
I have set the scale out limit to 1 3 hours ago and I've gotten two "Host Initialized" messages since.

I noticed that the "Initializing Host" message always follows a "Initializing Warmup Extension" message. The web tells me that this might happen during a scale out, which shouldn't happen. What's going on?

What concerns me is that I cannot find anything about hosts shutting down or dying anywhere. Surely loglevel = Information should be enough to bring those messages up.

0 Votes 0 ·

@TomGutzler-1570 You could try setting up Scale Controller Logs that could shed more light on what's happening. For a deeper analysis, it would be best to open a support ticket to investigate this further.

0 Votes 0 ·