DVA-C02 Question 379
Select 3You are developing a serverless application using AWS Lambda that processes images uploaded to an Amazon S3 bucket. You notice that the Lambda function is taking longer to execute as the size of the images increases, and your costs are rising. Which combination of actions can you take to optimize the application’s performance and reduce costs?
- A
Enable Amazon S3 Transfer Acceleration for faster uploads to the bucket.
- B
Use Amazon S3 event notifications to trigger the Lambda function only for specific file types or prefixes.
- C
Increase the memory allocated to the Lambda function to improve processing speed.
- D
Use AWS Step Functions to break down the image processing workload into smaller tasks.
- E
Enable Lambda function concurrency to process multiple files simultaneously.
Show answer and explanation
Correct answers: B, C, D
Explanation
To optimize the serverless application, you can use S3 event notifications to minimize unnecessary Lambda triggers, allocate more memory to improve processing speed, and use AWS Step Functions to distribute the workload more efficiently. These actions directly address both performance and cost concerns. Other options, like S3 Transfer Acceleration and Lambda concurrency, do not directly tackle the optimization of the Lambda function's performance or cost reduction for this specific workload.
- A. Incorrect.
Enabling Amazon S3 Transfer Acceleration improves upload speeds to the bucket, but it does not address the Lambda function's performance or cost optimization.
- B. Correct.
Using Amazon S3 event notifications to filter triggers reduces unnecessary Lambda invocations, optimizing performance and reducing costs by processing only relevant files.
- C. Correct.
Increasing the memory allocated to the Lambda function can improve its processing speed, as more memory provides additional CPU power, which can reduce execution time and cost.
- D. Correct.
Using AWS Step Functions allows you to divide the workload into smaller, more manageable tasks, optimizing processing and enabling better cost management.
- E. Incorrect.
Enabling Lambda function concurrency can help scale processing for multiple files but does not directly optimize performance or costs for individual file processing.