mikhailshilkov / mikhailio-hugo

Sources of https://mikhail.io migrated to Hugo
MIT License
12 stars 8 forks source link

Comments to "Reducing Cold Start Duration in Azure Functions" #7

Open mikhailshilkov opened 5 years ago

mikhailshilkov commented 5 years ago

Add your comment to Reducing Cold Start Duration in Azure Functions. The comments will be displayed directly on the page.

I might edit the format of your comments to make them display nicely on the website, sorry for that!

JasonBSteele commented 5 years ago

Great work Mikhail, this stuff is important and your in depth analysis really shines a light on it - thank you.

SteveALee commented 5 years ago

Thanks for this article. I must confess I'm still slightly confused by the various deployment options and which you are talking about .

When I previously used JS Function's on Windows (before Linux option) I found the node-modules folder had to be bundled to get a sensible cold start (there's a Microsoft repo for this somewhere).

I recently asked if this still applied or is perhaps different on Linux hosted functions as the slow Windows share seemed to be the problem - https://github.com/MicrosoftDocs/azure-docs/issues/27181 The answer suggested I should use the package deployment which appears to be different to the old zip method in Kudu and is perhaps the same as you mention as zip - or might be different. Can you shed any light? Thanks

mikhailshilkov commented 5 years ago

I describe these 3 deployment methods in the main article.

Basically, Local Zip and External Zip are "Run from Package" deployment as described here. I believe that's what you got recommended. As I mentioned, in theory, it should have reduced the cold start, but it hasn't.

All my Node.js tests are on Windows. I actually believe you can't get Node.js Consumption on Linux as of today.

SteveALee commented 5 years ago

Thanks for clarifying and it's good to hear there aren't even more options. I guess your 'local' is WEBSITE_RUN_FROM_PACKAGE=1. My next concern was as you found out it was not optimal when using blob storage. I guess that as well as the extra time loading the zip it has to unpack at cold start and perhaps local only does it at deploy time. I really should chek th ecode though :)

Re Lunix, I'm sure I read an announcement of GA but now can't find it. However, this docs article specificaly mentions JS on Linux (which is only via nodejs AFAIK). I would assume available on consumption as that is the entire point of Functions. But to be honest, I don't care if Windows or Linux hosted, unless have native modules or bash npm scripts (which are a pain on Windows npm as it assumes cmd).

Update: Ah, Linux on consumption plan is a limited preview right now.