Skip to main content

These questions are independently created for study purposes. They are not official AWS exam questions, actual exam questions, leaked questions, or exam dumps.

SAA-C03High-Performing ArchitecturesDifficulty:Normal

SAA-022

A Lambda function has long execution time and high CPU load. To improve CPU performance without changing the code, which setting should you consider first?

Choices

Explanation and answer

Read the explanation and correct answer (spoiler — try answering first)

Correct answer: C. Increase the Lambda memory size

Explanation

Increasing the Lambda memory size also increases the allocated CPU performance. For CPU-bound workloads, adjusting memory can shorten execution time.

Per-choice explanations

A. Disable CloudWatch Logs

Incorrect. Disabling logs does not address CPU performance.

B. Rename the Lambda function

Incorrect. Renaming the function does not change performance.

C. Increase the Lambda memory size

Correct. This is the first setting to review when tuning Lambda performance.

D. Always attach Lambda to a VPC

Incorrect. VPC attachment is used when network requirements demand it, not as a default performance optimization.

Practical Use

The AWS Lambda memory size setting determines not only the allocated memory but also a proportional vCPU performance and I/O bandwidth. Increasing memory from 128 MB to 1,769 MB allocates the equivalent of one vCPU core, which can significantly reduce execution time for CPU-bound workloads such as image conversion, encryption, JSON parsing, and machine learning inference. Billing is based on GB-seconds, so even when memory is doubled, the total cost may decrease if execution time drops by more than half. AWS Lambda Power Tuning (an open-source tool based on Step Functions) is a systematic way to tune memory. It runs the function in parallel across multiple memory settings and produces a cost-versus-execution-time chart. In practice, this tool is used to find the optimal setting and is combined with provisioned concurrency to reduce cold starts. Note that increasing memory has limited effect on workloads dominated by network I/O wait (for example, waiting on DynamoDB or external API calls). In those cases, parallelization and connection reuse (initializing clients outside the handler) are more effective. On SAA-C03, when the question describes "long Lambda execution time," "high CPU load," and "improve performance without changing code," memory size adjustment is the correct answer. Distractors such as renaming the function, disabling CloudWatch Logs, or always attaching to a VPC are unrelated to performance improvement. Advanced tuning techniques such as Power Tuning, provisioned concurrency, and SnapStart (for Java) are also asked in higher-level exams.

Related links

Related services