AWS Lambda
AWS Lambda is one of the computing services provided by AWS, which is event-driven and serverless. It is a stateless serverless system that helps us run our background tasks in the most efficient manner possible.
Benefits of AWS Lambda
AWS Lambda provides us the following benefits:
- Due to its serverless architecture, no need to provision or manage servers
- No need to set up any virtual machine (VM)
- Lambda tasks need not to be registered like Amazon SWF activity types.
- We can use any existing Lambda functions that you’ve already defined in workflows.
- Lambda functions are called directly by Amazon SWF; there is no need design a program to implement and execute them.
- Lambda provides us the metrics and logs for tracking function executions.
- Allows developers to run and execute codes in response to events without the need for building any infrastructure
- Pay as you go: Just pay for the compute time taken, only when the code runs. Also, pay only for the used memory and the number of processed code requests, and the code execution time is rounded up by 100 milliseconds.
- Easily monitor code performance in real time through CloudWatch
Limitations of AWS Lambda
AWS Lambda offers so many benefits, we might face a few limitations while working with AWS Lambda, due to its various characteristics w.r.t. its hardware and its architecture. few of the limitations are listed below:
- The maximum execution duration per request is set to 300 seconds (15 minutes)
- In the case of hardware, the maximum disk space provided is 512 MB for the runtime environment, which is very less
- Its memory volume varies from 128 MB to 1,536 MB
- The event request body cannot exceed more than 128 KB
- Its code execution timeout is only 5 minutes
- Lambda functions write their logs only to CloudWatch, which is the only tool available in order to monitor or troubleshoot our functions
Throttle Limit
The throttle limit is 100 concurrent Lambda function executions per account and is applied to the total concurrent executions across all functions within a same region.
The formula to calculate the number of concurrent executions for a function = (average duration of the function execution) X (number of requests or events processed by AWS Lambda).
When throttle limit is reached, then it returns a throttling error having an error code 429. After 15-30 minute you can start work again. The throttle limit can be increased by contacting AWS support center.
Resources Limit
The following table shows the list of resources limits for a Lambda function.
Resource | Default Limit |
---|---|
Ephemeral disk capacity ("/tmp" space) | 512 MB |
Number of file descriptors | 1,024 |
Number of processes and threads (combined total) | 1,024 |
Maximum execution duration per request | 300 seconds |
Invoke request body payload size | 6 MB |
Invoke response body payload size | 6 MB |
Service Limit
The following table shows the list of services limits for deploying a Lambda function.
Item | Default Limit |
---|---|
Lambda function deployment package size (.zip/.jar file) | 50 MB |
Size of code/dependencies that you can zip into a deployment package (uncompressed zip/jar size) | 250 MB |
Total size of all the deployment packages that can be uploaded per region | 1.5 GB |
Number of unique event sources of the Scheduled Event source type per account | 50 |
Number of unique Lambda functions you can connect to each Scheduled Event | 5 |
These limitations of AWS Lambda basically exist to ensure that the services are used as intended.
nice post.
ReplyDeleteaws training
r programming training