AWS Lambda

Understanding Lambda

Pricing

In this guide, we’ll dive into AWS Lambda pricing—covering the free tier, core billing components (requests and gigabyte-seconds), memory/CPU allocation, architecture choices, and additional cost factors like storage and concurrency. By understanding these elements, you can optimize your serverless workloads for both performance and cost.

Free Tier

AWS Lambda incurs no upfront fees. Each month, you receive:

  • 1 million free requests
  • 400 000 GB-seconds of compute time

Note

Free-tier usage resets every month. Usage beyond these amounts is billed according to the rates in your AWS Region.

Core Pricing Components

Lambda charges are based on:

  1. Number of requests
  2. Compute time measured in gigabyte-seconds (GB-s)

The image outlines the components of Lambda cost, highlighting the number of requests and gigabit seconds (amount of time multiplied by the amount of resources).

1. Requests

Each time your function handler begins execution—triggered by API Gateway, event sources, or manual tests—it counts as one request.

Price = (Total requests) × (Request rate per million)

2. Gigabyte-Seconds

Compute time is billed in GB-s, calculated as:

GB-s = (Allocated memory in GB) × (Execution duration in seconds)
  • Timer starts when the handler is invoked and stops after shutdown code completes.
  • Rounding is to the nearest millisecond.

Warning

AWS rounds up to the nearest ms, so a 1.0001 ms function is billed as 2 ms.

The image is a diagram illustrating the flow of data from a source to AWS Lambda, where a Lambda function is executed, and then to another AWS service. It includes a timeline for initialization and shutdown, labeled "Gigabit Seconds."

Memory and CPU Allocation

When you configure a Lambda function, you select memory between 128 MB and 10 240 MB. CPU power scales linearly with memory—more RAM also means more CPU share, speeding up execution and reducing GB-s.

The image illustrates a concept related to "Gigabit Seconds" with a focus on CPU and memory allocation for a Lambda function, showing a range from 128 MB to 10,240 MB.

CPU Architectures

Lambda supports two processor types. Choosing the right architecture can yield significant savings:

ArchitecturePrice-Performance ImprovementBest for
x86_64BaselineGeneral workloads
ARM64 (Graviton2)Up to 34% betterCost-sensitive, high-throughput jobs

Tip: ARM64 functions may require compatibility testing for native dependencies.

Additional Cost Factors

Besides requests and GB-s, consider these extras:

ComponentDescriptionBilling Unit
Ephemeral storageScratch space (/tmp) from 512 MB to 10 GBPer GB-month (region-based)
Provisioned concurrencyKeeps functions warm to avoid cold startsPer concurrency-second

Warning

Provisioned concurrency charges apply even during idle periods. Use only for latency-sensitive functions.

The image outlines pricing components for a service, highlighting memory range, ephemeral storage, provisioned concurrency, and cold start avoidance. It includes region-specific pricing and uses a lambda symbol.

Summary

Your AWS Lambda costs depend on:

  • Free-tier utilization
  • Request count
  • GB-seconds (memory × duration)
  • Memory/CPU allocation
  • CPU architecture (x86_64 vs ARM64)
  • Additional storage and concurrency settings

Next Steps

Use the AWS Pricing Calculator to model workloads and forecast costs.


References

Watch Video

Watch video content

Previous
Functions