DVA-C02 Troubleshooting and Optimization Practice Question
A developer is working on a serverless application that uses AWS Lambda functions to process user uploads. The uploads are stored in an S3 bucket, and each upload triggers a Lambda function that resizes images and stores metadata in DynamoDB. Recently, users have reported that some images are not being resized. The developer checks the CloudWatch logs and sees that the Lambda function is invoked, but it fails with a timeout error after 15 seconds for a few large images. The function has a timeout of 15 seconds and a memory of 512 MB. The image sizes vary from 1 MB to 50 MB. The developer wants to handle large images without increasing the timeout significantly, as that would increase costs. The function is CPU-bound during image processing. Which solution should the developer implement?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Increase the memory allocated to the Lambda function to 3008 MB, which also increases CPU power, allowing faster processing within the same timeout.
AWS Lambda allocates CPU power proportionally to memory, so raising memory from 512 MB to 3008 MB gives the function roughly 6x more CPU, letting the CPU-bound image resizing finish within the existing 15-second timeout without extending the timeout and thus without increasing per-invocation duration costs. This directly addresses the timeout caused by CPU-bound processing of large images. Option B is impractical because chunking and reassembling images adds complexity and does not speed up the CPU-bound resize work. Option C would allow more time but increases cost and duration, which the developer explicitly wants to avoid. Option D does not solve the underlying CPU bottleneck and Step Functions cannot extend a single Lambda invocation beyond its configured timeout.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Increase the memory allocated to the Lambda function to 3008 MB, which also increases CPU power, allowing faster processing within the same timeout.
Why this is correct
This is the most effective solution for CPU-bound tasks in AWS Lambda. Increasing the memory allocated to a Lambda function directly scales its proportional share of CPU power, network bandwidth, and disk I/O. For computationally intensive operations like image processing, providing more CPU resources allows the function to complete the task significantly faster, often within the existing timeout, and can even reduce overall costs by decreasing the total execution duration.
- ✗
Split the large images into smaller chunks before uploading to S3, then reassemble them after processing.
Why it's wrong here
Splitting large images into smaller chunks before processing introduces significant architectural and operational complexity. This approach requires custom logic for both pre-processing (splitting) and post-processing (reassembling), including managing chunk integrity, order, and potential partial failures. Furthermore, many image formats are not easily divisible without losing critical metadata or requiring complex re-encoding, making this solution impractical and inefficient compared to simply scaling the processing power.
- ✗
Increase the Lambda function timeout to 5 minutes to accommodate large images.
Why it's wrong here
While increasing the Lambda function timeout allows a function to run for a longer duration, it does not address the fundamental issue of insufficient computational power if the image processing is CPU-bound. A function with inadequate CPU resources will still process the image slowly, potentially hitting the new, longer timeout, or simply incurring higher costs for extended execution without a proportional increase in processing speed. The primary goal should be to complete the task faster, not merely to allow it to run longer inefficiently.
- ✗
Use AWS Step Functions to orchestrate the image processing workflow, allowing longer timeouts for individual steps.
Why it's wrong here
AWS Step Functions are valuable for orchestrating complex, multi-step workflows and managing state across various AWS services, including Lambda functions. However, simply using Step Functions does not inherently solve a CPU bottleneck within a single Lambda function's execution. If the core image processing logic is still performed by a single Lambda function that is CPU-starved, orchestrating it with Step Functions will only manage its execution flow and state, not accelerate the actual computational work performed by that specific Lambda instance.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
One of 1,135 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.