Home > other >  AWS Lambda with ECR image - latency when cold start?
AWS Lambda with ECR image - latency when cold start?

Time:10-10

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!

CodePudding user response:

Docker images will be definitely slower cold start. This is because of bigger size and additional OS. Lambda loads your code into its managed environment instead loading you whole docker image.

Links for reference: Some graphs comparing docker with native java lambda: cold start duration tasks & invocation duration tasks

I would advise you to definitely use the managed runtime as opposed to containers unless you need to use them as it will automatically result in faster execution.

  • Related