Schaemelhout
Schaemelhout

Reputation: 705

Azure Function reaching timeout without doing anything

I have an Azure Function app in Node.js with a couple of Queue-triggered functions.

These were working great, until I saw a couple of timeouts in my function logs. From that point, none of my triggered functions are actually doing anything. They just keep timing out even before executing the first line of code, which is a context.log()-statement to show the execution time.

LogOutput

What could be the cause of this?

Upvotes: 3

Views: 2991

Answers (1)

Matt Mason
Matt Mason

Reputation: 2726

Check your functions storage account in the azure portal, you'll likely see very high activity for files monitoring.

This is likely due to the interaction between Azure Files and requiring a large node_modules tree. Once the modules have been required once, functions will execute quickly because modules are cached, but these timeouts can throw the function app into a timeout -> restart loop.

There's a lot of discussion on this, along with one possible improvement (using webpack on server side modules) here.

Other possibilities:

  • decrease number of node modules if possible
  • move to dedicated instead of consumption plan (it runs on a different file system which has better performance)
  • use C# or F#, which don't suffer from these limitations

Upvotes: 1

Related Questions