AWS Certified Developer – Associate — Question 164
A software engineer developed an AWS Lambda function in Node.js to do some CPU-intensive data processing. With the default settings, the Lambda function takes about 5 minutes to complete.
Which approach should a developer take to increase the speed of completion?
Answer options
- A. Instead of using Node.js. rewrite the Lambda function using Python.
- B. Instead of packaging the libraries in the ZIP file with the function, move them to a Lambda layer and use the layer with the function.
- C. Allocate the maximum available CPU units to the function.
- D. Increase the available memory to the function.
Correct answer: D
Explanation
Increasing the memory allocated to an AWS Lambda function also increases the CPU resources available to it, as AWS allocates CPU power proportional to memory. This can significantly reduce execution time for CPU-intensive tasks. The other options do not directly address the CPU performance or completion speed as effectively as increasing memory does.