Lambda function limitations
AWS Lambda comes with certain limitations for function execution, such as memory, execution duration (by default up to 15 minutes), function environment variables (limited storage), disk space (including libraries and dependencies), and concurrent invocation limits (by default 1000 per region). These restrictions must be considered while designing and developing your application for effective and efficient use of AWS Lambda. Function limitations can be configured to some extent, but understanding these constraints is essential to ensure the smooth functioning of your application on this platform.
AWS Lambda Function Limitations: A Comprehensive Guide
What are Lambda Function Limitations?
AWS Lambda is a compute service that allows you to run code without managing servers. However, it comes with certain limitations, such as the maximum execution time, deployment package size, disk capacity (/tmp) per execution environment, etc.
How it Works?
When you run your application in AWS Lambda, it runs within certain configured limits. The service automatically scales the application in response to the incoming request traffic, however, within the set limits.
Answering Questions Regarding Lambda Function Limitations in an Exam:
To successfully answer the questions, focus on understanding the problem statement and the function's requirements. Identify if there are limitations such as 'execution time limit of 15 minutes' or 'concurrency limit of 1000' that might affect the solution's feasibility.
Exam Tips:
Remember the key limits of AWS Lambda - Execution time: maximum of 15 minutes, Memory allocation: 128 MB to 10,240 MB, /tmp directory storage: 512 MB, Deployment package (unzipped): 250 MB, Deployment package (zipped, including layers): 50 MB, Concurrency: 1,000 (can be increased upon request).
AWS Certified Solutions Architect - Lambda function limitations Example Questions
Test your knowledge of Lambda function limitations
Question 1
A Lambda function triggered by S3 PutObject events generates image thumbnails. During peak periods, users report slower thumbnail creation. CloudWatch shows p95 duration rising from 800 ms to 2.4 s, zero throttles, concurrent executions peaking at 150 (well below the account limit), and cold starts under 2%. The function performs CPU-bound image resizing with no external calls. Without changing the code, which configuration change will most effectively reduce per-invocation processing time?
Question 2
An e-commerce application uses AWS Lambda to process large data files uploaded to Amazon S3. Some files cause a single Lambda invocation to exceed the 15-minute maximum execution time. The company must keep a fully serverless design and continue using Lambda for processing. What should the developer do to reliably complete the processing?
Question 3
An application using Lambda functions to process API requests is running into issues handling regional disaster scenarios. What should be done to improve the robustness of the system?