How this calculator works
This calculator estimates your monthly serverless function bill by combining two charges: a per-request cost and a compute cost. It multiplies your invocations per month by the price per 1M requests to get the request charge, then computes GB-seconds from your memory allocation and average duration — memory in gigabytes multiplied by run time in seconds, across every invocation — and multiplies that by your price per GB-second. The three biggest drivers are how often the function runs, how much memory it holds, and how long each call takes, so a small change in duration or memory can move the total noticeably at scale.
The key trade-off is memory versus duration. Allocating more memory raises the per-GB-second rate you pay, but it often shortens execution time, so a higher memory setting can sometimes lower the total compute cost rather than raise it. Use the calculator to test a few memory levels against realistic durations before assuming that the smallest setting is the cheapest. Also remember that request charges scale purely with volume, so at very high invocation counts the flat per-request cost can rival compute — worth checking both lines separately.
Frequently asked questions
How is serverless priced?
Two meters: a flat charge per million requests, plus GB-seconds (memory allocated × execution time). Over-provisioning memory or writing slow functions inflates the GB-second half — often the larger one.
When does serverless stop being cheap?
At steady high load. Serverless shines for spiky or low traffic where you pay nothing when idle. Once a function runs constantly, a always-on container or VM is usually cheaper per request — cross the two curves before committing.
Curious where that crossover lands for you?
DigitalOcean gives $200 in free credit — spin up an always-on container and compare the real bill against this calculator's serverless number.