TL;DR
Lambda is the default, not the answer. Compare Lambda, Cloud Run, Container Apps, Fly.io, and Knative on pricing, cold starts, timeouts, and lock-in.
Ask a team where their API runs and the answer is usually "Lambda" — not because anyone compared platforms, but because Lambda was the default when the project started. That default was reasonable in 2018. In late 2026 it is a decision worth re-examining: Google Cloud Run now runs GPUs and worker pools, Azure Container Apps has a simplified Express tier, Fly.io bills machines by the second with scale-to-zero built in, and Knative brings serverless to any Kubernetes cluster you already own. The platforms have converged on the same promise — no servers to manage — and diverged on the things that decide your bill: the metering unit, the timeout, and who owns the substrate underneath.
The short version up front: if your traffic is bursty and your handlers are short, a function platform (Lambda or Cloud Run) is still the cheapest way to run code. If traffic is steady, an always-on machine (Fly.io) or a container service with a minimum instance usually wins, because you stop paying the per-request premium. If you already run Kubernetes, Knative is the honest answer — it gives you scale-to-zero without a second platform to learn. Everything below is the pricing maths, the limits, and the lock-in, so the choice is a calculation instead of a habit.
What "serverless" means in 2026
The word has stretched to cover three different products, and the confusion is the source of most bad platform picks.
Functions. You deploy code, the platform runs it per event. AWS Lambda is the archetype. You never see a container, you cannot SSH anywhere, and the platform decides how many copies run. The billing unit is the request plus the memory-seconds it consumed.
Serverless containers. You deploy a container image, the platform runs it and scales it — including to zero. Cloud Run and Azure Container Apps live here. You keep the container contract (any language, any framework, long-running processes inside the request), and the platform handles routing, scaling, and TLS. The billing unit is vCPU-seconds and GiB-seconds while requests are in flight, plus a per-request fee.
Machines that stop. You deploy a container or an image to a small VM that the platform starts on demand and stops when idle. Fly.io Machines are the clearest example. The billing unit is seconds of uptime, which makes the maths closer to renting a tiny server than to paying per request — and makes steady traffic dramatically cheaper than either of the other two models.
The distinction matters because the three models fail differently. Functions fail on duration caps and payload limits. Serverless containers fail on idle cost when you keep minimum instances warm. Machines fail on operational surface: you are closer to the metal, and the platform does less for you. Pick the model first, then the vendor inside it.
The five platforms, one by one
AWS Lambda: the default, and still the best event glue
Lambda's strength was never raw compute — it is the trigger surface. S3, SQS, DynamoDB Streams, EventBridge, API Gateway, and Step Functions all invoke functions natively, which is why Lambda remains the right answer for event-driven work inside AWS. The pricing is published on the AWS Lambda pricing page: $0.20 per million requests and $0.0000166667 per GB-second on x86 (Arm is about 20% cheaper), after a monthly free tier of 1 million requests and 400,000 GB-seconds. Memory runs from 128 MB to 10,240 MB, with CPU allocated in proportion — one full vCPU at 1,769 MB — and the default regional concurrency quota is 1,000.
One number changed recently and most guides still get it wrong: AWS raised the maximum on-demand timeout from 15 minutes to 30 minutes on 19 November 2026, for synchronous, asynchronous, and event-source-mapping invocations. The old 15-minute ceiling is still quoted everywhere, so if a comparison tells you Lambda cannot run a 20-minute job, it is out of date. The other caps did not move: 6 MB synchronous request and response payloads, 1 MB asynchronous payloads, and 10 GB of ephemeral storage. Provisioned concurrency — paying to keep functions warm — costs $0.0000041667 per GB-second on top of invocation charges, which is the price of eliminating cold starts for latency-sensitive paths.
Lambda's honest limits are the ones the pricing page cannot fix. You are inside AWS's runtime and deployment model: 250 MB unzipped deployment packages (larger via container images, up to 10 GB), no long-lived background process inside a single invocation, and the deepest vendor lock-in of any option here, because the triggers themselves are AWS services. For a deeper look at the cold-start side of this, see our cold-start guide.
Google Cloud Run: the container-native default
Cloud Run is the platform this comparison keeps coming back to, because it removes the two Lambda constraints teams hit first: the function packaging model and the short timeout. You deploy any container, it scales to zero by default, and a request can run for up to 60 minutes — four times Lambda's old limit and twice its new one. Per-instance ceilings are 8 vCPU and 32 GiB of memory, with concurrency up to 1,000 requests per instance, so one warm instance absorbs a burst that would need hundreds of Lambda invocations.
Pricing is on the Cloud Run pricing page: request-based billing charges $0.000024 per vCPU-second and $0.0000025 per GiB-second while requests are in flight, plus $0.40 per million requests, with a monthly free tier of 2 million requests, 180,000 vCPU-seconds, and 360,000 GiB-seconds. Instance-based billing — paying for the whole life of each instance at lower unit rates and no per-request fee — is the better choice once a service is busy most of the day. Cloud Run Jobs run to completion with task timeouts up to 7 days, and worker pools (generally available since April 2026) cover queue consumers without a public URL. GPU support is now routine: one NVIDIA L4 or RTX PRO 6000 Blackwell per instance for inference workloads.
The trade-off is that Cloud Run is a Google Cloud citizen. Its natural companions are Cloud SQL, Pub/Sub, and Artifact Registry, and while the container itself is portable, the IAM, networking, and observability around it are not. Cold starts exist — a container has to boot — and the fix is minimum instances, which bill at a reduced idle rate whether or not traffic arrives. Set a minimum of one and the "scales to zero" bill becomes a small always-on bill; that is a deliberate choice, not a bug.
Azure Container Apps: KEDA scaling for the Microsoft shop
Azure Container Apps (ACA) is Kubernetes with the Kubernetes removed: it runs on AKS under the hood, but you never see a node. Scaling is KEDA, so a service scales on HTTP concurrency, a Service Bus queue, Kafka lag, or any other KEDA scaler, and Dapr is built in for service-to-service calls, pub/sub, and state. The Consumption plan's pricing mirrors Cloud Run almost exactly — Azure's published rates are $0.000024 per vCPU-second active, $0.000003 per GiB-second, and $0.40 per million requests, with the same monthly free grant of 180,000 vCPU-seconds, 360,000 GiB-seconds, and 2 million requests. Idle replicas bill at a lower idle rate, and setting minReplicas: 0 takes the compute bill to zero.
The limits are tighter than Cloud Run's: a fixed 240-second request timeout, 4 vCPU and 8 GiB per replica in a workload-profiles environment (2 vCPU and 4 GiB in a consumption-only environment), and Linux/amd64 images only. The 240-second ceiling is the number that decides ACA for or against a workload — anything with long-running requests, large file processing, or slow model inference needs the jobs path or a different platform. The 2026 headline is Container Apps Express, which reached general availability in October 2026 alongside the Sandboxes layer it runs on: a simplified deployment path aimed at teams that found the environment-and-revision model too heavy. Serverless GPUs (T4 and A100) bill per second and scale to zero in 17 regions.
ACA is the right pick when the team is already on Azure and the workload is event-driven microservices with queue-based scaling. It is the wrong pick when requests run long or the team wants the largest instance shapes — that is Cloud Run's territory.
Fly.io Machines: the machine-rental model
Fly.io is the odd one out, and the most interesting. Your app runs as one or more Machines — Firecracker microVMs built from a Docker image — in 17 regions, billed per second while they run, with autostop and autostart on by default: when traffic stops, Machines stop, and the proxy starts them on the next request. A stopped Machine still bills $0.15 per GB per month for its root filesystem, but that is pennies next to running it.
The published rates make the model legible: a shared-cpu-1x machine with 256 MB running 24/7 costs $2.19 a month in Fly's lowest-priced regions (Ashburn and Secaucus), and a performance-1x machine with 2 GB costs $33.00 a month, with extra RAM at $6.00 per GB per month and regional multipliers up to 1.615x elsewhere. There is no free tier for new accounts — the old Hobby free allowances are legacy-only — and there are no billing caps or alerts, which is the sharpest edge on the platform: a runaway machine bills until you notice. Egress is $0.02 per GB in North America and Europe. Cold starts run about 2 seconds for a stopped machine, or a few hundred milliseconds resuming a suspended one.
Fly.io's strength is that a machine is a machine: no request timeout imposed by the platform, no payload ceiling, no per-request fee, and genuine multi-region deployment with a private WireGuard network between regions. Its weakness is operational surface — you are closer to infrastructure than on any other platform here, and the pricing has moved under buyers' feet (RAM rose 20% in October 2026). It fits small production services, globally distributed apps, and teams comfortable reading a usage-based bill. For a cost-first view of the same question, see our cost optimization guide.
Knative: serverless on a cluster you already own
Knative is the open-source answer, and the only option here that is not a vendor product: Knative Serving runs on any Kubernetes cluster and gives your services scale-to-zero, request-based autoscaling, and revision-based rollouts. The billing unit is whatever your cluster costs — there is no per-request meter at all — which makes Knative the cheapest option at scale and the most expensive in engineering time. You operate the cluster, the networking, and the autoscaler; Knative removes the serverless-shaped work, not the Kubernetes-shaped work.
The decision rule is simple: if the cluster already exists and the team already operates it, Knative's marginal cost is near zero and its lock-in is nil — the same container runs anywhere. If the cluster does not exist, do not build one to get serverless; that is buying a datacenter to avoid a function bill. Knative's default request timeout is 300 seconds and configurable per service, and it pairs naturally with eventing (Knative Eventing) for the same trigger patterns Lambda covers natively.
Pricing: the meter that bites
Unit prices across the big three look nearly identical — $0.000024 per vCPU-second is the same number on Cloud Run and Container Apps, and Lambda's GB-second rate converts to roughly the same vCPU-second price at 1,769 MB per vCPU. The bill differs because the metering unit differs, and the unit decides which workload shape is cheap.
Work the same request shape through two platforms and the gap shows. Take an API doing 50 million requests a month, 200 ms average duration, 512 MB of memory, in us-east-1 / us-central1 list prices:
Read the example honestly before quoting it. The sizing is each platform's natural shape: Lambda's 512 MB buys about 0.29 vCPU (a full vCPU needs 1,769 MB), while the Cloud Run figure allocates an explicit 0.5 vCPU. A CPU-hungry handler that needs a full vCPU flips the comparison — Lambda at 1,769 MB costs more per request than Cloud Run at 1 vCPU, because Cloud Run's per-vCPU-second rate is lower than Lambda's implied one. The rule that survives the arithmetic: I/O-bound, low-CPU handlers are cheapest on Lambda; CPU-bound handlers are cheapest on Cloud Run; steady traffic is cheapest on a machine. And the free tiers make the entire argument moot below about a million requests a month — at that volume, Lambda and Cloud Run both cost effectively nothing, and the decision should be about triggers and team skill, not price.
The other pricing trap is idle cost. Every platform sells scale-to-zero, and every platform sells a way to defeat it: Lambda provisioned concurrency, Cloud Run minimum instances, ACA minimum replicas. A minimum instance that bills at a reduced idle rate all month is a small always-on server wearing a serverless costume. Budget for it explicitly, or set the minimum to zero and accept the cold start.
Cold starts and latency
Cold starts are the tax scale-to-zero charges, and they differ by runtime, not just by platform. On Lambda, a Node or Python function typically starts in tens to a few hundred milliseconds; a JVM function can take seconds, which is why Java teams feel cold starts and Node teams barely notice them. Provisioned concurrency removes the tax for a fixed hourly price. On Cloud Run and Container Apps, the cold start is a container boot — usually a few hundred milliseconds to a couple of seconds depending on image size and language runtime — and minimum instances are the mitigation. On Fly.io, a stopped machine takes about 2 seconds to start, while resuming a suspended machine takes a few hundred milliseconds.
Three practices keep the tax small wherever you run. Keep images slim: a 50 MB image boots measurably faster than a 1 GB one on every container platform. Keep the handler's import graph lean: most cold-start time is the runtime loading your code and its dependencies, not the platform. And measure the p99, not the average — cold starts are a tail-latency problem, and an average that hides a 3-second p99 is how a "fast" API fails its users at 3 a.m. when traffic is thin and every request is cold.
Concurrency models matter as much as cold starts. Lambda runs one request per execution environment (concurrency is the scaling knob, and the default regional quota is 1,000). Cloud Run multiplexes up to 1,000 concurrent requests per instance, which is why a single warm Cloud Run instance absorbs bursts that need a fleet of Lambda environments. ACA defaults to 10 concurrent requests per replica. The practical consequence: a bursty API with spiky concurrency is cheaper and simpler on Cloud Run, while a steady stream of short events is Lambda's home turf.
Limits that decide for you
When two platforms look equal on price, the limits table usually breaks the tie. These are the ceilings as published in late November 2026 — verify them against the vendor docs before designing around them, because the Lambda timeout change this month is proof they move.
| Limit | Lambda | Cloud Run | Container Apps | Fly.io | Knative |
|---|---|---|---|---|---|
| Max request / invocation time | 30 min (since 19 Nov 2026) | 60 min (jobs: 7 days) | 240 s | No platform cap | 300 s default, configurable |
| Max compute per unit | 10,240 MB memory | 8 vCPU, 32 GiB | 4 vCPU, 8 GiB | Up to 16 vCPU, 128 GB RAM | Whatever the cluster allows |
| Scale to zero | Yes | Yes | Yes | Yes (autostop) | Yes |
| Payload ceiling | 6 MB sync, 1 MB async | 32 MB request | No documented cap | No platform cap | Configurable |
| Billing unit | Request + GB-second | vCPU-second + GiB-second + request | vCPU-second + GiB-second + request | Seconds of uptime | Cluster cost |
Two rows deserve emphasis. The 240-second Container Apps ceiling rules it out for long-running requests outright — no tuning fixes a hard cap. And Fly.io's lack of a platform timeout is the reason teams with 10-minute report generation or video transcoding end up there: the machine runs until the work finishes, and the only limit is what you are willing to pay for.
Lock-in and the exit cost
Serverless lock-in is rarely the code — it is the triggers, the IAM, and the state. A Lambda function whose triggers are S3 events, whose queue is SQS, and whose state is DynamoDB is not portable in any meaningful sense, even though the handler code is twenty lines of Python. The same is true of a Cloud Run service wired to Pub/Sub and Cloud SQL, or a Container Apps service scaling on Service Bus. The runtime is the portable part; the event mesh is the lock-in.
That is why the layered view matters: traffic and triggers, scaling, runtime, and state are separate layers, and only the bottom one — state and data — is genuinely hard to move. A team that keeps its state in portable stores (Postgres, Kafka, S3-compatible storage) and its triggers behind a thin adapter can move runtimes in a week. A team whose state lives in a proprietary queue and whose triggers are vendor events is rewriting the system, not migrating it.
Knative is the lowest-lock-in option by construction: the container is standard, the cluster is yours, and the scaling layer is open source. Fly.io is next — standard containers on machines you can reproduce elsewhere, though its proxy, volumes, and private networking are Fly-specific. The managed platforms trade that portability for the trigger surface and the operational offload, and for most teams that trade is correct. Just make it knowingly: write down which services would need replacing on exit, and check that list once a year.
The decision, as a flowchart
If the flowchart above is too compressed, here is the same logic as rules of thumb:
Architecture Decision
Decision: Choose the serverless platform by traffic shape and timeout, not by vendor habit: Lambda for bursty short handlers inside AWS, Cloud Run for containerised or long-running requests, Container Apps for Azure event-driven services, Fly.io Machines for steady small services, Knative when a Kubernetes cluster already exists — and a container service, not serverless, for batch-shaped work.
Context: The team defaults to Lambda for every new service. Some of those services are steady-traffic APIs paying a per-request premium for the privilege of scaling to zero they never use; some are long-running jobs fighting the timeout; and one is a CPU-bound handler whose bill would halve on a platform that meters vCPU instead of memory. The platform choice is being made by inertia, and the bill shows it.
Options considered: (1) The traffic-shape rule above — a different platform per shape, with state kept portable. (2) Lambda everywhere — one platform, one skill set, but per-request pricing on steady traffic and a 30-minute ceiling on long work. (3) Cloud Run everywhere — the most capable single platform, but Google Cloud lock-in on triggers and state, and per-request pricing on steady traffic. (4) Kubernetes plus Knative everywhere — lowest lock-in and no per-request meter, but the team operates a cluster for workloads that do not need one.
Why this one: The traffic shape is the only variable that predicts the bill, and it is knowable before writing code: steady or bursty, short or long, container or function. Matching the meter to the shape saves real money — the worked example shows a 4x gap between platforms on the same traffic — while keeping state portable bounds the exit cost of ever being wrong. No single platform wins all four shapes, so a single-platform rule is a decision to overpay on at least one of them.
What it costs you: More than one platform to know, which means more than one deployment path, more than one set of IAM and networking patterns, and a second bill to watch. The mitigation is to standardise the layers that do not differ — the container image, the observability, the CI pipeline — and let only the runtime and trigger layers vary. It also costs the discipline to re-check the limits table yearly; the Lambda timeout moved this month, and the next move will be just as quiet.
When to reverse it: When the team is small enough that one platform's simplicity is worth more than the savings — a three-person team should pick one platform and accept the overpay. Reverse toward a single platform when the multi-platform overhead (two deployment paths, two bills, two sets of runbooks) exceeds the price difference. Reverse toward Kubernetes and Knative when steady-state spend crosses the point where owning the cluster is cheaper than renting the meter — usually when several services are all always-on.
When NOT to use serverless
Long-running batch work. Anything that runs for hours, processes large files end to end, or trains models wants a job scheduler and a container service, not a function with a timeout. Use Cloud Run Jobs, Fargate, or a queue with workers — and see our serverless AI comparison for the inference-shaped version of the same question.
Stateful or connection-heavy workloads. Serverless instances are ephemeral, and every new instance opens a fresh database connection. A service that holds thousands of connections, keeps in-memory caches across requests, or relies on local disk will fight the model on every platform. Connection poolers (RDS Proxy, PgBouncer, Cloud SQL Proxy) paper over the connection problem; they do not fix the statefulness one.
Predictable, flat, high-volume traffic. If utilisation is flat at 60% or higher around the clock, scale-to-zero is a feature you pay for and never use. An always-on container or machine is cheaper — the Fly.io line in the worked example is the proof — and simpler to reason about.
Sub-100 ms latency budgets with cold-start exposure. If the p99 matters and traffic is thin, every request is a cold start on a scale-to-zero platform. Minimum instances fix it for a price; a small always-on service fixes it for less.
Teams without the operational appetite for a second platform. The traffic-shape rule only pays if the team can actually operate two platforms. If it cannot, pick the single best fit — usually Cloud Run or Lambda — and accept the overpay on the shapes it serves badly. A platform you cannot operate is more expensive than a platform that overcharges.
The honest summary is that serverless is a billing model with a timeout, not an architecture. The architecture is the same on every platform: triggers in, stateless handlers, state in a real store, observability everywhere. Choose the meter that matches your traffic, keep the state portable, and re-check the limits once a year — the platforms move faster than the blog posts about them.
Why This Matters
Understanding the business and technical context helps you make informed decisions rather than blindly following patterns.
Trade-offs to Consider
Every architectural decision involves trade-offs. Consider your specific requirements, team expertise, and scale when evaluating options.
When NOT to Use This
Knowing when a solution doesn't apply is as valuable as knowing when it does. Consider alternatives for your specific situation.
Decision Framework
Use this framework to evaluate whether this approach is right for your use case based on your specific constraints and requirements.