AWS Certified Developer – Associate (DVA-C02)Development with AWS ServicesMedium

A developer is building a serverless application that uses AWS Lambda functions. The application experiences occasional cold starts, leading to increased latency for initial requests, especially during peak traffic hours. To mitigate this issue and ensure consistent low latency for all invocations, which Lambda configuration should the developer enable?

  1. AIncrease the Lambda function's timeout setting.
  2. BImplement a custom warmer function to periodically invoke the Lambda.
  3. CConfigure Provisioned Concurrency for the Lambda function.
  4. DIncrease the Lambda function's memory allocation.
Show answer & explanation

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

Provisioned Concurrency initializes a requested number of execution environments for a Lambda function, ensuring they are ready to respond to invocations with very low latency. This directly addresses the cold start problem.

Why the other options are wrong

  • A. Increasing the timeout prevents the function from terminating prematurely but doesn't impact cold start latency.
  • B. A custom warmer function is a manual, less efficient, and less reliable workaround compared to AWS's managed Provisioned Concurrency feature.
  • D. Increasing memory can reduce execution time but doesn't directly eliminate cold starts for new execution environments.

Lambda Provisioned Concurrency

A Lambda feature that keeps functions initialized and hyper-ready to respond in double-digit milliseconds, eliminating cold starts.

  • Pre-initializes a specified number of execution environments.
  • Ensures consistent low latency for invocations.
  • Charged for the configured concurrency even when idle.

Memory trick: To make Lambda 'run fast' from the 'start', 'Provisioned Concurrency' plays its part.

More Development with AWS Services questions