mikhailshilkov / mikhailio-hugo

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

Comments to "Cold Starts in Google Cloud Functions" #4

Open mikhailshilkov opened 5 years ago

mikhailshilkov commented 5 years ago

Add your comment to Cold Starts in Google Cloud Functions. The comments will be displayed directly on the page.

markmssd commented 5 years ago

Great article 🎉 Would be interesting to see how it affects Deployment time!

mikhailshilkov commented 5 years ago

Thank you! Could you elaborate - what affects the deployment time?

markmssd commented 5 years ago

Oh sorry, the size of package.json. In Does Package Size Matter? section we clearly see that it affects cold starts, but what about functions deployment time?

pschlette commented 5 years ago

Thanks for posting this! I had no idea what kind of cold start time to expect for a Node function.

mcrobbj commented 5 years ago

So in comparison to Lambda is this just a problem when running in a VPC, and can it be negated by a keep alive?

mikhailshilkov commented 5 years ago

None of the above GCP charts are in VPC. VPC Access is in beta, maybe I'll add it later. As I show, Google is quite good at keeping alive on its own. Manual keep-alive might improve it further. However, you will get cold starts on any scale-out anyway.

camillo777 commented 5 years ago

For what I understand, Functions can work badly on an app with little traffic? 1 second of wait to me seems very long.

mikhailshilkov commented 5 years ago

YMMV. For most scenarios, this doesn't happen too often. Google keeps warm instances for a long time, and probably, your production application has enough traffic to hit a warm instance most of the time. If your 99 percentile is 1 second - is it that bad? It depends I guess.

lostllama commented 5 years ago

Thank you for doing this research, and your corresponding AWS Lambda research. It's interesting that Google's offering so much slower than Amazon's in terms of cold start times.

We're using Go, and it's interesting to see that the entire cold start range you measured on AWS is faster than the fastest speeds on Google.

AndreBerzun commented 4 years ago

What kind of work can you actually do with Cloud Functions? I mean, is it only intended for quick, lightweight operations or can you actually build somewhat complex HTTP endpoints with them? Has anyone experience with using them in a production environment?

mikhailshilkov commented 4 years ago

Functions can be as complex as you want them to make, as long as each invocation completes within 9 minutes and stay within other limits. The larger your codebase, the slower cold starts you might get. I haven't used Google Cloud Functions in production, but I did use AWS Lambda and Azure Functions, and they are a good fit for many scenarios, especially with the green-field cloud apps.

GriffinJohnston commented 4 years ago

For people trying to use the Firestore Admin SDK with Cloud Functions, there is a separate, known cold start issue being tracked here: https://issuetracker.google.com/issues/158014637 — while cold starts can be an issues anyway, trying to load Firestore inside a CF can result in ridiculous (10 seconds+) startup times.

Please visit that issue and star/comment. The squeaky wheel gets the grease.