Production Reality

Where The Bill Actually Comes From

Compute is rarely the biggest line. Log ingestion, wall-clock billing while you wait on somebody else, egress and idle network charges are, and the platform limit is itself a dependency.

Read your hosting invoice line by line, once, with somebody who understands it. Almost no founder has, which is why a cloud bill is a number that is fine and then suddenly is not, with no theory of why. The line you expect to dominate rarely does.

What compute actually costs

Take AWS Lambda as a well-documented example. It charges 0.20 dollars per million requests and 0.0000166667 dollars per gigabyte-second, with a monthly free allowance of one million requests and 400,000 gigabyte-seconds. So the request charge is usually small change, and the number that matters is duration times allocated memory. Memory is also a performance dial, because the platform scales processor share with it, which is why a function given more memory can cost less by finishing sooner. Measure that on your own slowest function rather than assuming it.

The axis nobody models is what you are billed for while waiting. On a platform that bills wall-clock duration, a function that spends 800 milliseconds waiting on a payment provider is billed for 800 milliseconds of doing nothing, so somebody else's 99th percentile lands on your invoice. Platforms are now moving towards billing processor time rather than wall clock, which changes the economics of an input-output bound function completely. Find out which model you are on before you design around either.

Logging is routinely larger than compute

CloudWatch Logs ingestion costs 0.50 dollars per gigabyte on the standard class and 0.25 on infrequent access, with five gigabytes free, and storage at 0.03 dollars per gigabyte per month. Now the arithmetic nobody does. A chatty function logging two kilobytes per invocation across fifty million invocations a month ingests roughly a hundred gigabytes: about fifty dollars of ingestion against about ten dollars of request charges. Logging is a bigger line than compute, and it got that way through one well-meaning statement that printed a whole object.

  • Log at a level, with debug sampled rather than on.
  • Never log a whole body inside a loop, which is how a hundred-gigabyte month happens from one line.
  • Set retention explicitly. On several platforms the default is to keep logs forever, and forever is a price.

The lines you never consciously provisioned

Two AWS charges exist entirely because of architecture decisions nobody remembers making. A NAT gateway costs 0.045 dollars an hour plus 0.045 dollars per gigabyte processed, charged per availability zone, so a three-zone setup is three gateways and roughly a hundred dollars a month before a single byte moves, plus a per-gigabyte charge on traffic you think of as internal. A public IPv4 address costs 0.005 dollars an hour whether in use or idle, a few dollars a month each and a real number once you have forgotten about thirty of them. These are not mistakes, they are the cost of a default network diagram, and a floor you pay while asleep.

Egress is the other one. Data arriving is usually free and data leaving usually is not, so the pattern that quietly costs money is serving images, video or large payloads from your origin rather than a cache in front of it. Supabase, for comparison, includes 250 gigabytes of egress on Pro and charges 0.09 dollars per gigabyte beyond it.

The limit that is itself a dependency

Netlify Functions currently allow sixty seconds for a synchronous function, fifteen minutes for a background function and thirty seconds for a scheduled one, with 1024 megabytes of memory by default and up to 4096 on paid plans, billed in gigabyte-hour units on credit-based plans. Note the word currently, and what this number has already done: the synchronous ceiling was ten seconds by default and twenty-six at most in the recent past. It moved, and anything built against the old figure either broke or silently became possible without anybody on your side doing anything.

Design to the shape of a platform limit, never to its current value. Anything that could plausibly take longer than a few tens of seconds belongs in a background job or a queue, whatever the ceiling says today, because the ceiling is a vendor decision and vendor decisions change underneath you. Then monitor the limits themselves, as you would any other dependency.

Database and plan costs, honestly

A managed database's monthly cost has four drivers: the compute tier, paid all month whether or not anyone visits; disk, which grows and on many platforms does not shrink back; egress; and backup or point-in-time retention. Quoting the base plan price is the standard founder error. Supabase Pro is 25 dollars a month including ten dollars of compute credits, which cover one project on the smallest compute size, with eight gigabytes of disk, so the real number is 25 dollars plus whatever compute you run, plus retention if you bought it.

The three cost controls that work

  • A budget alarm set at a number you chose before you needed one, plus an alert on usage rather than only on the invoice.
  • Separation you can attribute: a project, tag or account per environment, so that what is this costing and why takes a minute instead of an afternoon.
  • A unit cost for your main action, worked out once: cost per sign-up, per message sent, per report generated, including logs and egress. That is the number that tells you whether your pricing survives scale, and it is what makes the serverless argument decidable. Serverless is genuinely cheaper at low and bursty volume and genuinely more expensive at sustained high volume, and the crossover is a property of your workload rather than a matter of taste.

Key takeaways

1On Lambda the request charge is small change; the real figure is duration times allocated memory, and more memory can cost less because it finishes sooner.
2Wall-clock billing means you pay for waiting on a third party, so somebody else's 99th percentile lands on your invoice.
3At 0.50 dollars per gigabyte, 2 KB of logs across 50M invocations is about 50 dollars of ingestion against about 10 dollars of requests. Logs routinely cost more than compute.
4NAT gateways, idle IPv4 addresses and egress are the unprovisioned floor you pay while asleep, from a default network diagram nobody revisited.
5Platform limits move: Netlify's synchronous ceiling went from tens of seconds to sixty. Design to the shape, queue long work, monitor the limit as a dependency.

This is one lesson of 541.

The whole Foundation is free — 16 subjects, beginner to advanced. Sign in to track what you have read, take the end-of-module quizzes, and use the terminal.