Skip to main content
Welcome — this lesson explains AWS Lambda’s execution model, performance characteristics, resource constraints, and important operational considerations. Use this to design serverless functions that meet latency, throughput, and durability requirements.

Execution model and triggers

AWS Lambda is event-driven: functions run in response to events such as file uploads, scheduled tasks, or HTTP requests. Each invocation runs in an isolated execution environment and must be triggered by an event source. Lambda enforces a maximum execution duration of 15 minutes (900 seconds).
A slide titled "Execution Model" showing an AWS Lambda icon between a "Trigger" box and a "Next Step" box with arrows, illustrating an event-driven workflow. Below it is explanatory text stating that AWS Lambda triggers functions in response to events like HTTP requests, file uploads, or scheduled events.

Resource allocation: memory, CPU, and network

Memory is a primary configuration knob for Lambda and drives CPU and network performance. You set memory between 128 MB and 10,240 MB (increments of 1 MB). As memory increases, Lambda proportionally provides more CPU capacity and higher network throughput. Key points:
  • Memory range: 128 MB — 10,240 MB.
  • CPU scales with memory. A practical approximation is ~1 vCPU per 1,792 MB (1.792 GB); at 10,240 MB you approach roughly six vCPUs.
  • Network bandwidth scales with memory and CPU; higher-memory functions achieve greater throughput.
Because CPU and network scale only when you increase memory, tune memory for actual CPU/network needs, not just RAM usage.
A presentation slide titled "Resource Allocation" with two panels: Memory Allocation and vCPU Allocation. The Memory panel lists 128 MB–10,240 MB and notes impacts on CPU power and network, while the vCPU panel says CPU scales linearly with memory (1,792 MB ≈ 1 vCPU; up to 6 vCPUs at 10,240 MB).

Execution time, cold starts, and warm instances

Lambda timeout is configurable from 1 to 900 seconds. If your workload routinely needs >15 minutes, use containers or VMs. Cold starts:
  • Occur when Lambda must provision a new execution environment or initialize a runtime (language runtime, dependencies).
  • Add latency—commonly a few hundred milliseconds to several seconds depending on runtime, package size, and initialization complexity.
  • After an invocation, Lambda may keep the execution environment warm (often 5–15 minutes, not guaranteed). Subsequent invocations on a warm instance avoid the cold-start penalty.
If you require predictable low-latency responses, consider using Provisioned Concurrency to maintain initialized execution environments: https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html
A slide titled "Execution Time and Limits" with three colored panels for Timeout, Cold Starts, and Warm Starts. Each panel shows an icon and brief notes: 15-minute (1–900s) timeout, cold starts add latency (~100ms–1s), and warm instances run faster during a 5–15 minute warm period.

Invocation models

Lambda supports several invocation patterns; choose based on latency, durability, and processing needs. Stream-based event source mapping allows batch processing and checkpointing; it changes scaling and retry semantics compared to single-event invocation.

Networking and I/O

Network and I/O performance scale with memory/CPU settings. For network- or I/O-bound workloads, increase memory to gain higher throughput. Monitor bandwidth-sensitive operations (large uploads/downloads, external API calls) and size memory accordingly.
A presentation slide titled "Networking and I/O" showing a table of memory sizes and corresponding bandwidths (128 MB = low, 1,024 MB = medium, 10,240 MB = 10 Gbps). Notes on the right say network performance scales with memory allocation, i.e., higher memory = higher bandwidth.

Concurrency, throttling, and scaling behavior

Concurrency controls how many function instances run simultaneously. AWS enforces account- and region-level concurrency quotas.
  • Default regional concurrency quota: typically 1,000 concurrent executions (request increases via AWS Support).
  • Lambda supports burst scaling; the burst capacity and burst behavior vary by region.
  • Reserved concurrency: allocate a fixed concurrency pool to a function to guarantee capacity and isolate it from other functions.
    • If you reserve the entire account concurrency for one function, other functions will be throttled.
  • Throttling occurs when concurrent executions exceed available concurrency; use retries with backoff in client code.
Use reserved concurrency to protect critical workloads from noisy neighbors, but avoid over-reserving capacity.
A slide titled "Scaling" with a central blue box labeled "AWS Lambda Concurrency Limits" linked to boxes for "Burst Scaling" (left), "Sustained Concurrency" (right) and "Regional Variations" (below). The image includes a small © Copyright KodeKloud notice.

Availability and fault tolerance

Lambda is managed across Availability Zones in a Region. AWS provides redundancy for the service, but application-level design must handle partial failures:
  • Lambda will run execution environments across AZs; retries or re-invocations may be necessary depending on your event source and invocation model.
  • Design idempotent handlers and implement error handling/retry strategies for asynchronous events and stream-based processing.
A diagram titled "High Availability and Fault Tolerance" showing Region A split into two availability zones (AZ1 and AZ2), each containing an AWS Lambda function icon to illustrate redundant deployment.

Runtimes, package sizes, and storage

Lambda supports many runtimes (Python, Node.js, Java, .NET, Go, Ruby, Rust) and custom runtimes. Deployment and storage limits: For large dependencies, prefer container images (up to 10 GB) or use Lambda layers. Use EFS or S3 for persistent or shared storage.

Other operational considerations

  • Throttling: implement retries and exponential backoff for robust clients.
  • Cold starts: matter for latency-sensitive workloads — use Provisioned Concurrency when low-latency is required.
  • Payload/response limits: integrations (e.g., API Gateway) impose their own size limits; for large data, use S3/EFS or streaming patterns.
Exam tip: remember the 15-minute timeout (900 seconds), the approximate memory-to-CPU mapping (~1 vCPU per 1,792 MB), the default regional concurrency quota (typically 1,000), and that container images can be up to 10 GB.

Summary

AWS Lambda offers a highly managed, event-driven compute platform with fast scaling and a low operational footprint. The primary trade-offs:
  • 15-minute execution limit
  • Cold-start latency (unless using Provisioned Concurrency)
  • Memory is the primary performance dial (affects CPU and network)
  • Concurrency quotas and throttling need capacity planning
  • Stateless execution requires external persistence
Design functions with these limits in mind to achieve reliable, cost-effective serverless applications. That’s it for this lesson — good luck!

Watch Video