Courseiva

SOA-C02 Cost and Performance Optimization Practice Question

A SysOps administrator notices that a Lambda function is timing out after 30 seconds. The function processes large files from S3. How can the administrator improve performance while minimizing cost?

⚠ Common exam trap

Many exam-takers assume increasing the timeout is the only way to fix a timeout error, overlooking that Lambda's memory setting controls CPU allocation and can actually speed up execution to stay within the original timeout.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Increase the memory allocation of the Lambda function.

Increasing the memory allocation of the Lambda function also proportionally increases the allocated CPU power, which directly reduces the execution time for CPU-bound tasks like processing large files. This often resolves timeout issues without incurring additional cost per invocation, as the cost is a product of memory and duration, and a faster execution can offset the higher memory price.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Increase the timeout value to 5 minutes.

    Why it's wrong here

    Raising the timeout to 5 minutes merely lets the function run longer before failing; it does not reduce the actual execution time or improve the underlying performance problem. If the function is taking too long because of insufficient CPU or memory, it will likely time out again even with a larger timeout. Additionally, Lambda billing is duration-based, so allowing a slow function to run longer increases cost without fixing the root cause.

  • ✗

    Enable Provisioned Concurrency.

    Why it's wrong here

    Provisioned Concurrency pre-warms execution environments to eliminate cold-start latency, but it does nothing to speed up the code once the function is actually invoked. If the function is already warm and still exceeding its current timeout, the bottleneck is execution performance, not initialization overhead. Adding Provisioned Concurrency would increase costs and complexity without addressing the CPU or memory insufficiency causing the slowness.

  • ✓

    Increase the memory allocation of the Lambda function.

    Why this is correct

    Lambda allocates CPU power in direct proportion to the memory configuration, so increasing memory gives the function more compute capacity to execute faster. For CPU-bound or memory-intensive workloads, this can dramatically reduce execution time and prevent timeouts. Since Lambda billing is based on compute time, a shorter duration may actually lower overall cost, making memory tuning the primary lever for performance optimization.

  • ✗

    Deploy the function on an EC2 instance.

    Why it's wrong here

    Migrating the function to EC2 abandons the serverless model and introduces significant operational burden: you must manage patching, scaling, and high availability. It does not directly fix the inefficient execution or resource starvation that is causing the timeout. For most workloads, EC2 would be more expensive and slower to iterate on, whereas simply increasing Lambda memory would resolve the performance issue with minimal effort.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

This SOA-C02 question is part of Courseiva's 1,169-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SOA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SOA-C02 exam.