AWS Lambda Limits

AWS Lambda Limits

Lambda limits can be found on the service quota page



Soft limits

Concurrency

When invoking Lambda a container is started. You'd never see this but it is what executes the function.


After executing the function, the container exists for a short time. Each of these containers can execute one request.

There is a limit on the number of these containers running at once (10 or so).

Contact AWS Support for an increase in this


Storage


This applies to both the function and code in Lambda Layers

The soft limit in this respect is 75GB.

Contact AWS Support for an increase in this



Elastic Network Interfaces

This only applies to functions attached to a VPC.

This is needed to communicate with other resources, either internal or external

Realistically, this is unlikely to be hit due to the existence of AWS Hyperplane

Contact AWS Support for an increase in this


Hard limits

Execution Time

The maximum execution time is 15 minutes. AWS force stop any running functions at that stage

A common approach is to split tasks into smaller tasks. Lambda is great at running workloads in parallel.


Memory and CPU Constraints

When configuring Lambda, only the memory can be configured, the vCPU is relative to the memory allocation. The max is 10GB

Either optimise your code or split high memory tasks into smaller tasks.


Storage

Storage for Lambda is ephemeral and stored in /tmp.

The default storage size is 512MB and can be increased up to 10GB. Increasing this will increase the cost by increasing the charge per second.

Mitigate this by storing data in S3 or EFS. EFS requires the Lambda function to be connected to a VPC. Both of these options will increase cold starts.



Cold starts

I mentioned earlier about a container being started in the background to initiate the Lambda function. Each time one of these is started, this is referred to as a cold start.

These are regularly killed off by AWS to free resources, obviously these are running on servers and server space is limited.

Provisioned concurrency keeps a configured number of these running so there are no cold starts but these are charged.



Function size


Unzipped code has a limit of 250MB. This includes all layers.

The only mitigations here are limiting dependencies to those absolutely necessary and splitting functions.


Language support


Lambda supports many languages. A full list is here

It is possible to build and run your own runtime, the walkthrough is here


Network Limits


Lambda cannot have a static IP address and establishing rules to restrict outbound traffic isn't so easy. The only approach here is attaching the Lambda to a VPC and route traffic via a NAT Gateway or proxying outbound traffic.


Debugging

Running Lmabda locally isn't natively an easy task. You may wish to check out localstack for some support on this.

Another approach is to use the SST framework to debug code locally, other methods through SST include establishing a web socket directly to your Lambda.


要查看或添加评论,请登录

Adam King的更多文章

  • Terraform and why you might think twice about CDK or Cloudformation.

    Terraform and why you might think twice about CDK or Cloudformation.

    Multi-Cloud Go try using Cloudformation outside of AWS, go on, in the words of every school teacher "it's your own time…

  • Setting Up Multi-Region Active-Active with AWS Global Accelerator and Aurora Global Database

    Setting Up Multi-Region Active-Active with AWS Global Accelerator and Aurora Global Database

    Ever wondered how to make your app lightning-fast for users around the world while keeping it up and running even if a…

  • What AI services do AWS provide?

    What AI services do AWS provide?

    Firstly some clarity AI is what happens, LLM (large language model) is how. AI has rapidly become more prevalent over…

  • AWS Lambda Invocations

    AWS Lambda Invocations

    There are two types of invocation Synchronous With synchronous invocation, the request to execute an AWS Lambda…

  • What should be in your AWS Security Account? (Part 2)

    What should be in your AWS Security Account? (Part 2)

    This article will be a brief intro to AWS Security Hub. What is it? AWS Security Hub is a comprehensive security…

  • What to do if you lose your EC2 Keys

    What to do if you lose your EC2 Keys

    Whilst many companies have moved onto containerised solutions, there are still a lot around relying on EC2. N.

  • How to connect Github to AWS.

    How to connect Github to AWS.

    Options: Create Access Keys under the root user and add them to the CI/CD as plain text. Option 1 but use Github…

  • The confusion of the DevOps Engineer role

    The confusion of the DevOps Engineer role

    Definition I like to summarise that as "feedback to the business and providing that in a repeated and optimal way". But…

    5 条评论
  • It's time to change.

    It's time to change.

    Let's see how much of this is familiar to the organisation that you are in or have been at in the not too distant past:…

    1 条评论
  • Thoughts on Mentoring

    Thoughts on Mentoring

    For the past few years, I've mentored those around me, with less experience; mostly through an unofficial capacity…

社区洞察

其他会员也浏览了