Design High-Performing Architectures
Tests of a Lambda function show durations of 4 seconds at 512 MB, 1.5 seconds at 1,024 MB, and 1 second at 2,048 MB. With architecture and other charges unchanged, which memory setting has the lowest compute cost while meeting a 2-second duration requirement?
Show the answer
Correct answerD. 1,024 MB
AWhy not this: The 4-second duration exceeds the 2-second requirement despite the smaller memory allocation.
BWhy not this: The settings have different compute costs, and the 512 MB setting fails the duration requirement.
CWhy not this: The function meets the duration requirement but consumes 2 GB-seconds rather than 1.5 GB-seconds.
DWhy this is right: The function meets the duration requirement and has the lowest memory-duration product among qualifying settings.
Lambda compute charges depend on allocated memory multiplied by duration. At 1,024 MB, the function uses 1.5 GB-seconds and meets the requirement; 2,048 MB uses 2 GB-seconds, while 512 MB misses the duration requirement.