InfyCalculator
💻

Serverless Request Cost Calculator

Estimate the monthly cost of a serverless function from its request count, execution time, memory size and the per-request and GB-second rates.

Requests per month
Avg duration per request
Memory allocated
Price per 1M requests
Price per GB-second
Loading calculator…

How it works

GB-seconds = requests × (duration ÷ 1000) × (memory ÷ 1024) · Compute = GB-seconds × $/GB-s · Requests = (requests ÷ 1M) × price · Total = compute + requests

Serverless platforms charge on two axes: a flat fee per request and a compute fee measured in gigabyte-seconds — memory in GB multiplied by run time in seconds. Doubling either the memory you allocate or the duration of the function doubles the compute portion, so a slow function on a large memory tier can cost far more than its request count suggests. For short, high-volume functions the per-request fee dominates; for long-running or memory-heavy ones the GB-second compute charge takes over.

Worked example

Ten million requests at 200 ms and 512 MB use 10,000,000 × 0.2 × (512 ÷ 1024) = 1,000,000 GB-seconds. At $0.0000166667/GB-s that is about $16.67 of compute, plus (10 ÷ 1) × $0.20 = $2.00 of request charges, for roughly $18.67 a month.

Frequently asked questions

What is a GB-second?

A GB-second is one gigabyte of allocated memory held for one second of execution. If a function uses 512 MB (0.5 GB) and runs for 2 seconds, that is 0.5 × 2 = 1 GB-second. Providers bill compute in these units, so both memory size and run time drive the cost.

Should I lower the memory to save money?

Not always — higher memory tiers also get more CPU, so a function may run fast enough on more memory that the shorter duration offsets the higher per-second rate. Test a couple of memory settings and compare total GB-seconds, since the fastest tier is sometimes the cheapest overall.

Are free tiers included?

No — this calculator prices every request and GB-second. Most providers include a monthly free allotment (often 1M requests and 400,000 GB-seconds), so subtract that allowance from your totals if your usage is small enough to benefit.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.