DVA-C02 - Troubleshooting and Optimization (18% of the exam) - Section 4.5

Optimise application performance by tuning AWS Lambda memory and concurrency and by profiling minimum compute requirements.

Optimise AWS Lambda performance by profiling execution duration at different memory settings to find the configuration that minimises cost per invocation. Apply provisioned concurrency to eliminate cold-start latency for latency-sensitive functions and set reserved concurrency to cap maximum parallel executions.

Lambda memory tuningConcurrencyPerformance profilingProvisioned concurrency

Practice question for this objective

Free sampleTroubleshooting and Optimizationhard

A CPU-bound Lambda function is configured at 256 MB and its CloudWatch REPORT lines show high billed duration with Max Memory Used staying near 90 MB. The developer needs to cut tail latency for compute-heavy invocations and also empirically find the memory value that minimises cost per invocation, doing so against the real workload with the least manual trial and error. Which TWO actions together meet these goals? (Select TWO.)

  • ARaise the memory configuration so the function receives proportionally more vCPU, then confirm whether the faster billed duration offsets the higher per-millisecond price. Correct
  • BRun AWS Lambda Power Tuning, a Step Functions state machine that invokes the function across a sweep of memory values and charts billed duration and cost to reveal the optimum. Correct
  • CLower the memory configuration toward the observed 90 MB peak so the per-millisecond price drops, since memory usage is the only factor that drives Lambda billing.
  • DEnable provisioned concurrency on the function alias so pre-initialised environments shorten the compute time of each individual CPU-bound invocation.
  • EIncrease the function timeout so compute-heavy invocations have more time to complete, which reduces their billed duration and overall cost.
Tune CPU-bound Lambda functions by raising memory to gain proportional vCPU and use Lambda Power Tuning to profile the memory value that minimises cost. Lambda scales vCPU with configured memory, so raising memory speeds CPU-bound work and the shorter billed duration can outweigh the higher per-millisecond rate. Lambda Power Tuning sweeps memory values against the real workload and charts cost versus speed, surfacing the optimum without manual reconfigure-and-rerun cycles.

Why A is correct: Lambda allocates CPU in proportion to configured memory, so a CPU-bound function gains more vCPU and finishes faster when memory is raised, which can lower total cost despite a higher rate.

Why B is correct: Power Tuning automates the sweep across memory settings using the real payload and plots cost versus speed, finding the optimum with far less manual reconfiguration and re-running.

Why C is wrong: Tempting because Max Memory Used is low, but cutting memory on a CPU-bound function removes vCPU, lengthens billed duration, and billing is duration times memory, not memory alone.

Why D is wrong: Provisioned concurrency removes cold-start init latency for new environments but does nothing for the per-invocation compute time of an already-warm CPU-bound handler.

Why E is wrong: Tempting as a knob for long-running work, but timeout is only an upper bound on runtime; it never speeds execution or lowers billed duration, which is the measured run time.

See more DVA-C02 practice questions, answers explained.

Exam traps in Troubleshooting and Optimization

Answers that look right on this material and are not. Each one is a distractor from a different question in the DVA-C02 bank for this domain.

  • Raise the function's reserved concurrency so a larger guaranteed slice of the account concurrency pool is set aside for it, ensuring enough environments exist to serve the burst traffic without throttling.

    Why it is wrong: Reserved concurrency caps and guarantees how many instances may run but does not pre-initialise any of them, so the first requests in a burst still pay the cold-start cost that drives p99 latency.

  • The cost per invocation rises in direct proportion to the memory, so doubling memory always doubles the price no matter how much the billed duration falls afterwards.

    Why it is wrong: This ignores the duration half of the gigabyte-second formula; cost is memory multiplied by time, so a large drop in duration can offset or outweigh the memory increase rather than always doubling the price.

  • Set the memory to the maximum of 1769 MB so the function always receives a full vCPU, then assume that this configuration is the cheapest because each invocation finishes in the shortest possible time.

    Why it is wrong: Maximum memory gives the most CPU but is not automatically cheapest, because cost is duration multiplied by memory, so a faster run at high memory can still bill more than a balanced setting.

Examworthy is not affiliated with or endorsed by Amazon Web Services. Original, blueprint-aligned practice material only.