Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will the cold starts of my AWS Lambda function take longer if I use an ECR image/containers?

Will the cold starts of my AWS Lambda function take longer if I use a image from ECR instead of a jar from S3 as my source code? I'm thinking that yes, because the image is larger due to the additional OS layer (even though... the regular Lambda should have some OS layer as well), but I couldn't find any performance benchmarks.

Thanks!

like image 356
user361676 Avatar asked Sep 10 '25 23:09

user361676


1 Answers

I'm surprised at the conclusion of the other answers here.

IT DEPENDS

Linked earlier, this blog post performs data tests. From that post:

enter image description here enter image description here

If your function is a pure function. It'll perform way better (1st picture) as most have said, but once your function acts more like a Framework the size of the zip grows and all it takes is a few megs and S3 is simply too slow.

To be clear, your container/program needs to have a fast start time, but that's irrespective of the size or lambda.

That second graph is incredible, 5GB container loading in < 2s.

like image 51
nitsujri Avatar answered Sep 13 '25 12:09

nitsujri