Courseiva

DVA-C02 Troubleshooting and Optimization Practice Question

A developer is troubleshooting an AWS Lambda function that processes messages from an Amazon SQS queue. The function is configured with a batch size of 10 and a maximum concurrency of 5. The function frequently reports errors related to message processing timeouts. The function code is idempotent. Which combination of actions will reduce the number of timeouts and improve processing efficiency?

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

✓

Reduce the batch size to 5 and increase the maximum concurrency to 10.

Reducing the batch size to 5 decreases the number of messages processed per invocation, lowering the processing time and reducing the likelihood of timeouts. Increasing maximum concurrency to 10 allows more Lambda functions to run in parallel, improving overall throughput. Option A is wrong: increasing the Lambda timeout to 30 seconds alone does not address the root cause (overloaded invocations), and setting the SQS visibility timeout to 6 minutes may cause delayed retries if messages fail. Option B is wrong: increasing the batch size to 20 would increase the processing time per invocation, exacerbating timeouts. Option D is wrong: increasing concurrency to 10 helps parallelism but does not reduce the per-invocation workload; setting visibility timeout to 30 seconds is too short, risking message duplication if processing exceeds that time.

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 function timeout to 30 seconds and set the SQS visibility timeout to 6 minutes.

    Why it's wrong here

    Increasing the Lambda function timeout to 30 seconds might temporarily prevent timeouts but does not address the underlying performance issue, potentially masking inefficiencies. While setting the SQS visibility timeout to 6 minutes (360 seconds) correctly ensures it is greater than the Lambda timeout, preventing duplicate processing, this combination still avoids optimizing the function's execution time, which is the primary goal for efficiency and cost.

  • ✗

    Increase the batch size to 20 and increase the function timeout to 30 seconds.

    Why it's wrong here

    Increasing the SQS batch size to 20 means each Lambda invocation processes more messages, inherently increasing the execution time per invocation. While increasing the function timeout to 30 seconds might prevent immediate timeouts, this approach exacerbates the problem by demanding more work from each function instance, potentially leading to higher latency and increased costs without improving the actual processing efficiency per message.

  • ✓

    Reduce the batch size to 5 and increase the maximum concurrency to 10.

    Why this is correct

    Reducing the SQS batch size to 5 messages per invocation decreases the amount of work each Lambda instance must perform, thereby lowering the execution time and reducing the likelihood of timeouts. Simultaneously, increasing the maximum concurrency to 10 allows more Lambda instances to run in parallel, effectively processing multiple smaller batches concurrently. This combination optimizes for faster individual processing while scaling out to maintain or improve overall message throughput.

  • ✗

    Increase the maximum concurrency to 10 and set the SQS visibility timeout to 30 seconds.

    Why it's wrong here

    While increasing the maximum concurrency to 10 is beneficial for processing more messages in parallel and improving overall throughput, setting the SQS visibility timeout to only 30 seconds is problematic. If a Lambda function invocation takes longer than 30 seconds to process its batch, the messages will become visible again in the queue, potentially leading to duplicate processing by another Lambda instance before the original invocation completes, resulting in data inconsistencies or wasted compute cycles.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

Courseiva writes every DVA-C02 question from scratch — 1,135 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.