A developer has deployed an AWS Lambda function that performs CPU-intensive image resizing. During testing, the function successfully processes small image files, but frequently times out when processing larger image files. The developer wants to increase the processing speed of the function to prevent these timeouts. Which configuration change should the developer make?
- AIncrease the function's execution timeout limit to 15 minutes.
- BDeploy the Lambda function in a private VPC subnet without a NAT gateway or VPC endpoints.
- Increase the memory allocation for the Lambda function.Cevap
- DHardcode AWS access keys directly in the function initialization code to bypass IAM role evaluation latency.
Cevap
Increase the memory allocation for the Lambda function.
Increasing the memory allocation is the correct solution because AWS Lambda allocates CPU power proportionally to the configured memory. By allocating more memory, the function automatically receives more CPU capacity, which directly speeds up CPU-intensive processing tasks like image resizing.
Adım Adım Çözüm
Anahtar Kavram
AWS Lambda resource allocation and scaling behavior (memory and CPU relationship)