Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lambda downtime while deploying new version

By default, AWS uses the LATEST alias for the latest lambda version updated and I assume the below step.

  1. Now, LATEST alias points version 5.
  2. User deploys the new version of the lambda.
  3. While deploying the new version, LATEST alias still points version 5.
  4. When the deploying is complete, Lambda just switches LATEST alias to version 6.

Through the steps, lambda seems to have almost 0 downtime.

However, It is just an assumption.

Is there any document explicitly mentioning about the downtime while deploying the new version? I just want to know how much AWS guarantee downtime while deploying the new version.

I also found similar question here, however not clear for my question.

like image 377
SangminKim Avatar asked Jul 19 '18 14:07

SangminKim


People also ask

What happens when Lambda is deployed?

It creates a CodeDeploy application and deployment group. The deployment group manages the rolling deployment and the rollback (if needed). It detects when you create a new version of your Lambda function. It triggers CodeDeploy to start the deployment of the new version.

How long does it take to deploy Lambda?

The whole process takes 10 minutes to complete. After completion, open the Lambda console and verify that the “live” alias now points to version 2: After 10 minutes, the deployment is complete and CodeDeploy signals success to CloudFormation and completes the stack update.

What happens when Lambda gets throttled?

At the highest level, throttling just means that Lambda will intentionally reject one of your requests and so what we see from the user side is that when making a client call, Lambda will throw a throttling exception, which you need to handle. Typically, people handle this by backing off for some time and retrying.

What happens when Lambda timeouts?

Note: When a Lambda function invocation times out, a Task timed out error message appears in the failed invocation's CloudWatch logs, not an Error message. If you search your function's CloudWatch logs for Error messages only, then the search returns only code-related runtime errors, not invocation timeout errors.


Video Answer


1 Answers

AWS Lambda uses containers for deployment. If I had to guess, AWS is spinning up Version 6 while Version 5 is still active, then once Version 6 is ready, it applies whatever changes necessary to point traffic to the now live Version 6. The below article mentions somewhat the AWS Lambda container lifecycle:

https://aws.amazon.com/blogs/compute/container-reuse-in-lambda/

like image 141
rickjerrity Avatar answered Sep 27 '22 19:09

rickjerrity