Murphybro2
Murphybro2

Reputation: 2679

Consumption Plan Azure Functions - cold start tactics

First of all, I know there have been previous questions on this topic, but I haven't been able to get the answers I need from them.

Secondly, I am well aware that I could pay more to upgrade and the issue would mostly go away, but that cost is pretty wild, so I'm excluding that as an option.

So, here are questions:

  1. Do I need to warm up each function within a function app? Or, will warming up 1 of the 7 functions within the app warm all of the functions up? I have a feeling this will be a "maybe" or "it depends" answer.

  2. Providing the whole function app will be warmed up by triggering one function, which of these options is most recommended:

    • Use an availability test to trigger one of the functions.
    • Create a new function called "KeepWarm" that simply returns a 200, and use that for the availability test (this won't work if each function needs calling).
    • Create a function that is invoked by a timer trigger that runs every 5 minutes and does nothing. I actually have a timer triggered function already that runs every hour and does some storage reads, but there would be no issue if it ran every 5 minutes instead.

Many thanks!

Upvotes: 1

Views: 427

Answers (1)

Alex Pshul
Alex Pshul

Reputation: 692

To keep matters simple, let me short:

  1. Yes. The scale unit is the entire app, not a specific function.
  2. I would go for a timer trigger that does nothing. You can control the timer and how often it fires. If you need the function app to not have a cold start during the day but you are OK with some cold start during the night, you could set the timer to fire only during the day and stop at night.

If having a response as soon as possible is important to you, I would consider the use of Azure Container Instance with just the part you need to be fast. This will not be as expensive as having a Premium function up in the air and in simple scenarios it could eliminate the cold start delay you want to remove.

Upvotes: 0

Related Questions