AWS Certified Developer – Associate / Question #1005 of 557

Question #1005

A developer is designing a serverless application on AWS that uses an AWS Lambda function to process data streams from Amazon Kinesis Data Streams. The Lambda function is experiencing high latency during peak traffic periods due to insufficient CPU resources to process the incoming records efficiently. The developer needs to optimize the Lambda function's configuration to reduce latency without altering the core functionality. Which solution will address this issue?

A

Increase the number of virtual CPU (vCPU) cores allocated to the Lambda function.

B

Increase the memory allocation for the Lambda function to scale its CPU proportionally.

C

Increase the size of the Lambda function's ephemeral storage to improve data caching.

D

Increase the Lambda function's concurrency limit to handle more simultaneous requests.

Explanation

AWS Lambda allocates CPU power proportionally to the memory configured for the function. By increasing the memory (Option B), the Lambda function receives more CPU resources, enabling it to process Kinesis records faster and reduce latency during peak traffic.

- Why other options are incorrect:
- A: Lambda does not allow direct adjustment of vCPU cores; CPU scales automatically with memory.
- C: Ephemeral storage (e.g., /tmp) is unrelated to CPU/processing speed and does not resolve latency caused by insufficient CPU.
- D: Concurrency limits control parallel executions, but Kinesis processing is constrained by shard count, not concurrency. The issue here is per-execution CPU capacity, not parallelism.

Key Points:
- Lambda CPU scales with memory.
- Kinesis Data Streams processing is limited by shard count and per-shard Lambda capacity.
- Optimize CPU-bound functions by increasing memory allocation.

Answer

The correct answer is: B