Bird
0
0

A company uses Lambda functions with 256 MB memory running 200 ms per request. They want to reduce cost without changing code. Which approach helps most?

hard📝 Best Practice Q15 of 15
AWS - Lambda
A company uses Lambda functions with 256 MB memory running 200 ms per request. They want to reduce cost without changing code. Which approach helps most?
ASwitch to EC2 instances for better pricing
BReduce memory size to 128 MB if function still runs correctly
CIncrease number of requests to use free tier fully
DIncrease memory size to reduce execution time
Step-by-Step Solution
Solution:
  1. Step 1: Understand cost relation to memory and time

    Cost = requests x memory size x execution time. Reducing memory lowers GB-seconds cost if function still works.
  2. Step 2: Evaluate options

    Reducing memory to 128 MB saves cost if performance is acceptable. Increasing memory or requests raises cost. Switching to EC2 is a different model and may not be cheaper.
  3. Final Answer:

    Reduce memory size to 128 MB if function still runs correctly -> Option B
  4. Quick Check:

    Lower memory reduces GB-seconds cost [OK]
Quick Trick: Lower memory if function still works to save cost [OK]
Common Mistakes:
MISTAKES
  • Increasing memory without checking cost impact
  • Thinking more requests reduce cost
  • Assuming EC2 always cheaper than Lambda

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes