AWS Certified Solutions Architect – Associate (SAA-C03)Design Cost-Optimized ArchitecturesHard

A startup is designing a new microservices architecture on AWS. Each microservice is implemented as an AWS Lambda function. The architects are concerned about the cost of cold starts and want to optimize the total cost of ownership. The Lambda functions typically process requests within 500ms and are invoked frequently throughout the day. Which Lambda feature should they utilize to reduce cost impacts from cold starts?

  1. AIncrease the memory allocated to the Lambda function.
  2. BConfigure Provisioned Concurrency for the Lambda function.
  3. CDeploy the Lambda function in a VPC.
  4. DUse a smaller Lambda function timeout.
Show answer & explanation

Correct answer: B. Configure Provisioned Concurrency for the Lambda function.

Provisioned Concurrency keeps Lambda functions initialized and ready to respond in milliseconds. While it comes with a cost for the pre-initialized environments, for 'frequently invoked' functions where cold starts are a concern and 'optimizing total cost of ownership' is key, it can reduce overall costs by preventing frequent cold starts that might lead to longer execution times (and thus higher billing duration) or poor user experience.

Why the other options are wrong

  • A. Increasing memory can reduce cold start times by allocating more CPU, but it also increases the cost per invocation. It's a performance optimization, not a direct cost optimization for cold starts.
  • C. Deploying Lambda in a VPC can sometimes increase cold start times due to network interface setup, making it counterproductive if the primary goal is to optimize cold starts unless VPC access is absolutely required.
  • D. A smaller timeout might reduce the maximum possible cost of a single long-running invocation, but it doesn't address cold starts and could lead to function failures if legitimate invocations exceed the timeout.

Lambda Provisioned Concurrency

Provisioned Concurrency initializes a specified number of execution environments for a Lambda function, ensuring that they are ready to respond to invocations with minimal latency.

  • Eliminates cold starts for a defined number of invocations.
  • You pay for the configured concurrency even when the function is idle.
  • Ideal for latency-sensitive applications with predictable traffic.
  • Balances cost (for pre-warmed environments) with performance.

Memory trick: Provisioned Concurrency: Prepare, Perform, Pay Less Per Start.

More Design Cost-Optimized Architectures questions