How to use this calculator
- Enter or choose invocations per month.
- Enter or choose average duration.
- Enter or choose memory allocated.
- Enter or choose memory conversion.
- Enter or choose billing increment.
- The monthly cost updates as you type. Use Copy result or Share to keep it.
Method
Billed ms = ⌈Duration ÷ Increment⌉ × Increment; GB-s = Invocations × Billed ms ÷ 1,000 × Memory MB ÷ MB-per-GB; Cost = (Invocations − Free) ÷ 10⁶ × Request price + (GB-s − Free GB-s) × GB-s price
- Increment
- billing granularity in milliseconds
- MB-per-GB
- 1,024 or 1,000 depending on the provider
Worked example
- GB-seconds: 3,000,000 × 0.120 s × (512 ÷ 1,024) GB = 180,000.
- Compute: 180,000 × 0.0000166667 = 3.00.
- Requests: 3 million × 0.20 = 0.60. Total 3.60.
At these example prices, 3 million 120 ms invocations at 512 MB cost about 3.60 a month.
What the result means
More memory raises the price per second but often shortens the run, because CPU usually scales with memory. Test a few memory sizes: the cheapest setting is where duration × memory is lowest.
Assumptions and limits
- Every invocation runs for the average duration.
- Free allowances apply to this function’s usage only.
- Provisioned concurrency, ephemeral storage, data transfer and calls to other services are not included.
Questions
What is a GB-second?
One gigabyte of memory allocated for one second. A 512 MB function running for 2 seconds uses 1 GB-second.
Why does the billing increment matter?
With 100 ms rounding, a 120 ms function is billed as 200 ms, two-thirds more than its real duration. With 1 ms rounding it is billed for 120 ms.