Course contentsShow
← Cloud and Infrastructure
Lesson 468 of 2,9899. Serverless ComputeFree lesson

FaaS Pricing Model

Understand pay-per-invocation and execution time pricing with no idle charges.

FaaS Pricing Model

What You'll Learn

You'll understand how FaaS charges you only for actual compute time, never for idle resources—a fundamental shift from traditional server billing.

How FaaS Pricing Works

With FaaS, you pay for two things and two things only: the number of times your function runs (invocations) and how long each execution takes (compute time). There's no charge when your function sits idle.

Pay-Per-Invocation

Every time an event triggers your function, that's one invocation. Cloud providers typically include a generous free tier (often millions per month), then charge a tiny amount per request—usually fractions of a cent per million invocations.

Execution Time Charges

You're billed for the milliseconds your function actually runs, multiplied by the memory you've allocated to it. A function configured with 512MB that executes for 200ms costs less than one running for 2 seconds with the same memory. The formula is usually:

Cost = (Memory × Duration) × Price per GB-second

No Idle Charges

This is the game-changer: unlike EC2 instances or VMs that bill 24/7 whether busy or not, FaaS charges zero when no one invokes your function. If your API receives 10 requests per day, you pay for ~10 executions, not a full month of server uptime.

Practical Example

Think of it like a taxi versus owning a car. With traditional servers (the car), you pay for ownership whether you drive or not. With FaaS (the taxi), you only pay when you actually take a trip, based on distance and time traveled.

Key Takeaway: FaaS pricing eliminates idle costs by charging only per invocation and execution duration—making it extremely cost-effective for sporadic, event-driven workloads with unpredictable traffic patterns.