Search code examples
amazon-web-serviceslambdaaws-lambdaaws-lambda-layers

AWS Lambda Layers Performance


Are there any measurable performance advantages to AWS Lambda Layers related to cold start, runtime, or deployment/install time, or is the primary advantage the modularization and sharing of code?


Solution

  • It depends on your requirements.

    An example use case is a lambda that needs a big, unchangeable, datastore to operate. Then it might be a performance boost to have it via layer instead of downloading it dynamically over and over again.

    In addition, it spares space in the deployment package, which allows both faster deployments and console editing.

    Last, the latest feature from AWS, extensions, uses layers to run an additional process on the same container (next to the lambda) and thus allowing parallelism. As a disclosure, I'm working on a company named Lumigo that troubleshoot serverless applications, and we used layers to have the whole python runtime so we could have a single extension that works on all the runtimes (reference: https://github.com/lumigo-io/lambda-log-shipper)