-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep warm #134
Comments
Because it only keeps one instance warm? Terracotta pretty much always fires at least a couple of requests at once, so during a cold start only the first request hits the warmed-up instance, while the others trigger a cold start of one new instance each. |
Since it's one of the fundamental downsides to Lambda there's not much we can do for low-traffic services. Maybe display a "please stand by" banner in the client. |
If it's low traffic, then it shouldn't be an issue that it only keeps one instance warm. |
Wrote my previous comment before your edit @dionhaefner, I see the issue there. |
This guy has a custom keep-alive script that he uses to keep 10 containers warm https://www.zrzka.dev/2016/10/30/aws-journey-api-gateway-lambda-vpc-performance.html |
If you keep too many containers warm it just becomes a more expensive version of EC2. Don't know how much there's to gain (10 might be fine though). |
I think it would have to be quite a lot of containers we would be keeping warm, for it to be more expensive than EC2? According to the blog post i just linked, we only have to fire |
For 10 containers, we are talking ~30000 requests per month |
But I don't think that this should be a Terracotta feature? Seems more like something you would set up on the side. Maybe we can mention it in the docs. |
Yep. It would be cool if you could do some testing with that. |
Will do. |
I thought once there was one warm container, spinning up more was comparatively cheap because they just clone the existing one (rather than cold-starting new instances from scratch). So all you would need is a seed. But maybe cloning is still too expensive (we are talking many concurrent requests for TC) or my understanding was wrong. |
If there is such as thing as cloning (and this is the first time I hear about it) it's not effective enough 😕 |
A Microsoft guy talked about that the other day. Aparently Azure Functions do that. I took it for general practice. |
That was also how I understood it, that once the first container was running, they basically just did a memcpy to spawn the others. |
Zappa by default keeps the function warm, it seems: https://github.com/Miserlou/Zappa/blob/3ccf7490a8d8b8fa74a61ee39bf44234f3567739/zappa/cli.py#L1169
But we are still seeing long cold starts. Why could that be?
The text was updated successfully, but these errors were encountered: