7

AWS Lambda recently added the option to create functions from docker containers (small warning: the ECR needs to be in the same account for now). I was wondering: except for all the advantages of docker over random ZIPs, is this also quicker to start, or quicker to call?

Roelant
  • 4,508
  • 1
  • 32
  • 62
  • 1
    From my experience it is definitely faster to use zip deployment, because it loads your code into its managed environment instead loading you whole docker file (at least 25 MB probably much larger). This is at least true for cold start. For warm start I don't know, but I think the difference is negligible. – Lau Mar 16 '21 at 12:55
  • 1
    You may find [this post](https://chariotsolutions.com/blog/post/getting-started-with-lambda-container-images/) useful. Short answer is that it takes longer to initialize a Dockerized Lambda. But that may change over time. – kdgregory Mar 16 '21 at 13:01
  • Does this answer your question? [Will the cold starts of my AWS Lambda function take longer if I use an ECR image/containers?](https://stackoverflow.com/questions/69512271/will-the-cold-starts-of-my-aws-lambda-function-take-longer-if-i-use-an-ecr-image) – dskrvk Jan 21 '22 at 23:45

2 Answers2

1

I have just used a Lambda container for a big API project in my company and I haven't personally seen slow downs in start time. I would believe that it may take a few more milliseconds to boot, but I think is negligible.

You could test it printing the times in CloudWatch, but I would avoid going to the Docker route if it's not needed because of all the pain that it is setting it up and getting a nice testing environment.

In relation to other pros and cons, I could write a whole essay here. Each has its perks, but as of a rule of thumb, only use the Dockerized Lambda if you really need it.

Raphael Setin
  • 557
  • 5
  • 10
-5

They'll take the same amount of time to call.

hb2638
  • 109
  • 2
  • 2
  • 5
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 28 '22 at 06:45