Frequently Asked Questions
Why does entering my provider's per GB-hour price give an enormous compute charge?
The field is labelled per GB-second and the engine multiplies it by GB-seconds. A per GB-hour price is many times larger than the per-second price, so entering it unchanged inflates the compute line by the same factor. Divide the hourly figure by the number of seconds in an hour and enter that result instead. The default of 0.00001667 is a per-second style value.
Should I enter memory in megabytes or gigabytes?
Gigabytes. The default of 0.5 GB stands for half a gigabyte. If you type a megabyte figure into the field, the engine treats it as that many gigabytes and the compute charge becomes absurdly large. Convert first: divide megabytes by the number of megabytes in a gigabyte your provider uses. An allocation of one eighth of a gigabyte is 0.125 here and gives $3.40 with the other defaults.
Why is the request charge only $0.80 when there are 5000000 calls?
Two reasons. The first 1000000 calls are covered by the included allowance, leaving 4,000,000 billable. The request price is then applied per million calls, not per call, so 4 million times the default 0.2 gives $0.80. If you enter a price per single call, the request charge will be a million times too small, so check the unit on your rate card.
Does a function that waits on a database cost money while it waits?
In this model, yes. Duration is the full wall-clock time of each call, and compute is charged on that time multiplied by memory. A function that spends most of its 250 ms waiting for a response is billed the same as one that computes for 250 ms. Cutting waiting time, or batching several pieces of work into one call, lowers the compute line directly.
Can I use this for a function that runs on a schedule rather than on demand?
Yes. Count how many times the schedule fires in a month and enter that as invocations, with the average duration and memory of each run. A job that runs every minute fires roughly forty-four thousand times in a month. Long scheduled jobs often have high duration, so the compute line will dominate and the request charge will usually fall inside the allowance.
How do cold starts affect the estimate?
A cold start adds time to the first call on a new instance, and on most platforms that time is part of the billed duration. The calculator has no separate cold start input, so fold it into your average duration. If a tenth of calls take much longer because of cold starts, measure the true mean over a full day of traffic and enter that, rather than the warm case.
Is the result in my local currency?
The Display Currency setting only changes the symbol shown. The arithmetic uses whatever rates you enter, so if your rate card is in another currency, enter its compute and request prices as quoted and set the display to match. The calculator does not convert between currencies or add any sales tax that your provider may charge on the bill.
What if my function runs on several memory sizes at once?
Run the calculator once per function or per memory setting and add the totals. The included allowance usually applies to the whole account, so only subtract it once: set Included to zero on every run but one. Mixing different memory sizes into a single averaged figure works for compute, but it is easier to check separate runs against your bill.
Why does halving memory not always halve my real bill?
On the page it does: going from 0.5 GB to 0.25 GB cuts compute from $10.42 to $5.21. In practice a smaller allocation can come with less processor share, so a compute-heavy function may run longer and give back some or all of the saving. Measure duration at the new size and enter both values together before deciding.
How accurate is this compared with an actual invoice?
For the function charge alone, it should be close if your inputs match the provider's billing units and rounding. The invoice will usually be higher because it adds logging, data transfer, gateways, retries and any free compute allowance the calculator ignores. A good check is to enter last month's real invocation count and average duration, then compare the compute line with the invoice.
How $11.22 a month is built from two separate charges
With nothing changed, the estimate comes to $11.22 a month. That figure is two charges added together, and they behave very differently, so it pays to read the supporting lines before the headline.
The compute charge is $10.42. It comes from 5000000 invocations, each running for 250 ms with 0.5 GB of memory allocated. Multiply those three and you get 625000 GB-seconds of compute, which is then multiplied by the compute rate of 0.00001667. The request charge is the other $0.80. It is a flat price per call, applied only to calls above the included allowance.
So in the default case, more than nine tenths of the bill is compute. That ratio is typical of functions that do real work for a quarter of a second. It changes completely for very short functions, where the per-call charge can become the larger part. Looking at which line dominates tells you which input is worth your attention: if compute dominates, duration and memory are the levers; if requests dominate, the only lever is making fewer calls.
Entering rate card prices in GB-seconds and per million requests
The compute price field is labelled in currency per GB-second, and the engine multiplies it directly by the GB-seconds it has worked out. Nothing else is applied to it, so the unit you enter must match that label exactly. The default of 0.00001667 only produces the $10.42 compute charge if it is read as a price for one gigabyte of memory held for one second.
This matters when you copy a price from a rate card. If your provider quotes compute per GB-second, enter it exactly as quoted. If you have a figure per GB-hour, divide it by the number of seconds in an hour before entering it, or the compute charge will come out thousands of times too high. If the provider quotes per GB of memory per millisecond or per some other block, convert it to a per-second figure first.
The request price is labelled in currency per 1M requests, so the engine divides billable calls by one million before applying it. The default of 0.2 means 0.2 per million requests, which is how 4,000,000 billable calls become $0.80. Enter the per-million price from your rate card, not a price per single call, or the request charge will come out a million times too small.
Duration and memory move the bill in exactly the same way
Because compute is invocations times seconds times gigabytes, doubling either duration or memory doubles the compute charge. Doubling the duration from the default 250 ms gives $21.64 a month. Running it with 1 GB of memory instead of 0.5 GB also gives $21.64. Both settings land on 1.25 million GB-seconds.
Halving memory to 0.25 GB brings the total down to $6.01, and dropping to 0.125 GB gives $3.40. Cutting duration to 100 ms gives $4.97. In each case the request charge stays at $0.80, because the number of calls has not changed.
The calculator treats duration and memory as independent, but on many real platforms they are not. More memory often comes with more processor share, so a function that is limited by computation may finish faster with a larger allocation. If doubling memory halves the duration, the GB-seconds stay the same and the cost barely moves while latency improves. If the function mostly waits on a database or another service, extra memory buys nothing and simply doubles the compute line. Measure duration at each memory size you are considering, then enter the matching pair. A quick way is to run the same test payload a few dozen times at each size, note the average billed duration from the platform metrics, and run this calculator once per pair. The cheapest pair is often not the smallest memory setting, and the fastest is often not the largest.
Where the included allowance applies and where it does not
The Included field covers requests only. The default allows 1000000 free calls a month, which is why only 4,000,000 of the 5000000 invocations are billable. Setting Included to zero raises the request charge from $0.80 to $1.00 and the total to $11.42.
There is no field for a free compute allowance. The engine charges every one of the 625000 GB-seconds, from the first. If your provider also gives a monthly block of free GB-seconds, the calculator will overstate your bill by the value of that block. You can correct for it by hand: work out the free GB-seconds as a share of your total, and reduce the compute rate by the same share, or simply subtract the value of the free block from the compute line yourself.
When invocations fall below the allowance, billable requests go to zero but compute is still charged. With 0.8 million invocations and the other defaults, the request charge is $0.00 and the total is $1.67, all of it compute. That is a useful check on small projects: a modest number of calls with heavy memory can still cost more than you expect.
Scaling the invocation count from 3000000 to 7500000 calls a month
The page compares three volumes. At 3000000 invocations the total is $6.65, at the default 5000000 it is $11.22, and at 7500000 it is $16.93. Compute scales in a straight line with calls, from $6.25 to $10.42 to $15.63, matching 375000, 625000 and 937500 GB-seconds.
The request charge does not scale quite so neatly, because the first million calls are free. It goes from $0.40 to $0.80 to $1.30, following billable requests of 2,000,000, then 4,000,000, then 6,500,000 at the top volume. The allowance makes small workloads look cheaper per call than large ones, and the effect fades as volume grows.
A practical way to use this is to enter a realistic month and a busy month, not an average year divided by twelve. Serverless bills follow traffic closely, so a launch week or a seasonal peak shows up directly. Knowing what the peak month costs is usually more useful for budgeting than the mean.
Getting a duration figure that matches what you are billed for
The Duration input expects the average execution time in milliseconds per invocation. The best source is your platform's own metrics for an existing function, averaged over a typical period. A figure measured on your laptop will usually be wrong, because the cloud runtime, network distance and memory size all differ.
Use the average, not the median and not the fastest run. Billing adds up every millisecond of every call, so a small share of slow calls pulls the real total upward. If a tenth of your calls hit a cold start or a slow downstream service, the mean can be well above the typical case.
Providers also round billed duration in different ways, some to the nearest millisecond and some up to a larger block. The engine does no rounding: it multiplies the exact duration you enter. For very short functions, where a call of a few milliseconds might be billed as a larger block, enter the billed duration rather than the measured one, or the estimate will be low.
Costs that sit outside the function bill
The calculator notes that networking, logs, retries, provisioned concurrency and provider rounding are not included. On real projects some of these can rival the function charge. Each invocation that writes logs adds log storage. Each response that leaves the provider's network adds data transfer. An API gateway in front of the function usually has its own per-request charge.
Retries are easy to miss. If a function fails and is retried automatically, each retry is a billed invocation with its own duration. A workload with a few percent of failing calls should have its invocation count raised by that amount.
Provisioned or reserved capacity, used to avoid cold starts, is billed for time it is kept warm whether or not it is called. That cost is not driven by invocations at all, so add it separately. Treat the result here as the core function charge, and build the full monthly figure around it.
Comparing this estimate with a server or container
A common reason to run this calculator is to decide whether serverless is cheaper than a machine that runs all month. The result gives you the variable cost at a given traffic level. A server gives you a roughly fixed cost regardless of traffic.
Run the calculator at several invocation counts and note where the monthly total crosses the fixed price of the alternative. Below that point serverless is cheaper; above it, a steady machine may be. Because the compute line grows in a straight line with calls, the crossing point is easy to find once you know the alternative's price.
Remember to compare like with like. The alternative needs its own operations time, patching and spare capacity for peaks, none of which appear in this calculator. And the serverless figure here excludes the extras listed above. A fair comparison adds those to both sides before choosing.