Home Do not breach the total code size limit of your Lambda

Do not breach the total code size limit of your Lambda

-

Users should be aware of AWS Lambda limits to have an effective internal capacity planning of their resources in place. Keeping an eye on these service limits can help you control and avoid overuse of services.

Keep a check on the total code size limit of your Lambda

AWS Lambda imposes a default usage limit on your compute and storage resources to run, as well as, store functions. This limit is defined per AWS region.

Resource
Default limit per region
Concurrent executions 1000
Function and layer storage 75 GB

 

Besides, the following limits have been defined for configuration, deployments, and execution of Lambda function which you cannot change:

Resource Limit
Function memory allocation 128 MB to 3,008 MB, in 64 MB increments.
Function timeout 900 seconds (15 minutes)
Function environment variables 4 KB
Function resource-based policy 20 KB
Function layers 5 layers
Invocation frequency (requests per second) 10x concurrent executions limit (synchronous – all sources)

10x concurrent executions limit (asynchronous – non-AWS sources)

Unlimited (asynchronous – AWS service sources)

Invocation payload (request and response) 6 MB (synchronous)

256 KB (asynchronous)

Deployment package size 50 MB (zipped, for direct upload)

250 MB (unzipped, including layers)

3 MB (console editor)

Test events (console editor) 10
/tmp directory storage 512 MB
File descriptors 1,024
Execution processes/threads 1,024

 

It, therefore, becomes important for developers to be aware of such limits in order to avoid any overuse and mismanagement of the resources.

You can keep tabs on your Lambda resource limits with the help our service limit check for Lambda’s total code size. Using this insight, you can easily see the available capacity of your Lambda’s code size. If the capacity limit is about to breach then, you can request for increasing the same from their AWS management console.

Insight descriptions:

There can be 3 possible scenarios:

Severity Description
CRITICAL This indication will be displayed when the user has breached 100% of the specified limit of the corresponding resource.
WARNING This indication will be displayed when the user has breached 80% of the specified limit of the corresponding resource.
OK This indication will be displayed when the user has consumed less than 80% of the specified limit of the corresponding resource.

 

Description of further columns are as follows:

  1. Account Id: This column shows the respective account ID of the user’s account.AWS Lambda-s44
  2. Account Name: This column shows the corresponding account name to the user’s account.AWS Lambda ss2
  3. Region: This column shows the region in which the corresponding resource exists.AWS Lambda ss32
  4. Limit Amount: This column shows the limit of the resource which is available. Here, the limit refers to the Lambda code size (in bytes)AWS Lambda-ss1
  5. Current usage: This column shows the current usage level of the corresponding resource.AWS Lambda-ss15
  6. Service: This column shows the type of service limit.AWS Lambda-ss3

Compliances covered:

Compliance Name Reference No. Link
Trusted Advisor https://console.aws.amazon.com/trustedadvisor/home?#/category/service-limits

 

Filters applicable:

Filter Name Description
Account Id Applying the account Id filter will display all the resources for the selected account Id.
Region Applying the region filter will display all the resources corresponding to the selected region.
Severity Applying severity filter will display the resources according to the selected severity type. This means selecting Critical will display all resources with critical severity. Same will be the case for Warning and Ok severity types.

 

Read more about AWS Lambda limits:

[1] https://docs.aws.amazon.com/lambda/latest/dg/limits.html

[2] https://docs.aws.amazon.com/lambda/latest/dg/welcome.html

Cloud

Cloud Management