DVA-C02 exam dumps

DVA-C02 practice question 319 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 319

Select 3

A developer has deployed a Lambda function that processes events from an Amazon SQS queue. The function is intermittently failing due to timeout errors, and the developer notices that the function execution duration is close to the configured timeout limit. To optimize and troubleshoot the issue, what should the developer do?

  1. A

    Increase the Lambda function’s timeout setting.

  2. B

    Enable AWS X-Ray tracing for the Lambda function to identify performance bottlenecks.

  3. C

    Modify the function code to process multiple SQS messages in a single invocation.

  4. D

    Create a dead-letter queue (DLQ) for the Lambda function to capture failed messages.

  5. E

    Reduce the batch size for messages being retrieved from the SQS queue.

Show answer and explanation

Correct answers: A, B, C

Explanation

To address the timeout errors effectively, the developer should first increase the Lambda function’s timeout limit to prevent immediate failures. Using AWS X-Ray tracing provides deeper insights into where the function is spending time, enabling targeted optimizations. Additionally, processing multiple messages in a single invocation can reduce invocation overhead and improve performance. While a DLQ is a good safety mechanism for failed messages, it does not resolve the root cause of the timeout errors. Reducing the batch size is unlikely to help and may worsen performance by increasing the number of invocations.

  • A. Correct.

    Increasing the Lambda function’s timeout setting allows the function to run longer, but this is only a workaround if the root cause of the issue is not addressed. However, it can be part of a broader solution when combined with other optimizations.

  • B. Correct.

    Enabling AWS X-Ray tracing can help identify where the Lambda function is experiencing delays, allowing the developer to address specific bottlenecks in the code or external dependencies.

  • C. Correct.

    Modifying the function code to process multiple SQS messages in a single invocation can reduce the overhead of frequently invoking the Lambda function, leading to better performance.

  • D. Incorrect.

    Creating a dead-letter queue (DLQ) is a good practice for capturing failed messages, but it does not directly address the root cause of the timeout issue.

  • E. Incorrect.

    Reducing the batch size for messages being retrieved from the SQS queue can help in some cases, but it may actually increase the number of invocations and thus exacerbate the timeout issue if the function is invoked too frequently.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam