Serverless Function Unit Cost Estimator

The Serverless Function Unit Cost Estimator converts request volume, function duration, allocated memory, and provider rates into an estimated cost per one million invocations. It separates request charges from compute charges so teams can see which part of the function profile is driving unit economics.

This model is useful for architecture reviews, internal chargeback, pricing decisions, or comparing optimization work across functions. Provider billing rules differ, so the rate fields are deliberately editable rather than tied to one cloud vendor. Enter the rates and billable assumptions that apply to your environment.

Usage and billing inputs

million
ms
MB
USD
USD
USD
Result
Estimated cost per 1M invocations
Estimated monthly cost
Request charges
Compute charges

1. Enter monthly invocation volume
Use billable function invocations for a typical or planned month, expressed in millions.

2. Use billed duration
Enter the average duration that is actually billed, not necessarily raw execution time if the platform rounds duration.

3. Set allocated memory
Use the configured memory allocation for the function because compute billing commonly scales with memory and duration.

4. Enter provider-specific rates
Use the request rate per million and the compute rate per GB-second from the pricing terms that apply to your account and region.

5. Include additional monthly cost
Add serverless-related charges you want allocated to this function, then review both total monthly cost and unit cost.

GB-seconds = Invocations × (Billed duration in seconds) × (Memory MB ÷ 1,024)

Total monthly cost = Request charges + GB-seconds × Compute rate + Other monthly cost

Cost per 1M invocations = Total monthly cost ÷ Monthly invocations in millions

The estimator uses the rates entered by the user and does not apply free tiers, tiered pricing, minimums, architecture multipliers, or provider-specific rounding beyond the duration you enter.

What the result means

The main result is the blended estimated cost to process one million invocations at the entered workload profile and monthly volume.

For vendor comparison, enter equivalent billable duration, memory, and rate assumptions for each option.

Given
8 million invocations
180 ms billed duration
512 MB memory
$0.20 per million requests
$0.0000166667 per GB-second
$12 other monthly cost

Calculation
GB-seconds = 8,000,000 × 0.18 × 0.5 = 720,000
Request charges = 8 × $0.20 = $1.60
Compute charges ≈ 720,000 × $0.0000166667 = $12.00
Total ≈ $25.60
Cost per 1M = $25.60 ÷ 8 = $3.20

Result
Estimated unit cost ≈ $3.20 per million invocations.

Why are the cloud rates editable?

Serverless pricing varies by provider, region, architecture, contract, and date. Editable fields let the calculator model the rates that actually apply to your workload.

Should I enter execution time or billed duration?

Use billed duration when available because that is what determines compute charges. If the provider rounds execution time, incorporate that rounding into the average entered value.

Where do free-tier credits belong?

This estimator does not automatically apply free tiers. You can model a steady monthly credit by reducing other cost only if doing so accurately represents the allocation you want to analyze.

Does memory allocation affect CPU performance too?

Some platforms tie CPU entitlement or performance to memory size, but this calculator uses memory only to calculate GB-seconds. Performance effects should be tested separately.

How can I compare two functions fairly?

Compare cost per million at equivalent traffic and billable workload assumptions. If one function performs different work or has different latency requirements, unit cost alone may not represent value or performance.